forked from qt-creator/qt-creator
iossim: correct bring to front for Xcode 6
Change-Id: I7e161a20a4b24635df4f6f373966c7e52cfb593b Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
17
src/tools/3rdparty/iossim/iphonesimulator.mm
vendored
17
src/tools/3rdparty/iossim/iphonesimulator.mm
vendored
@@ -261,16 +261,25 @@ static void ChildSignal(int /*arg*/) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)session:(DTiPhoneSimulatorSession *)session didStart:(BOOL)started withError:(NSError *)error {
|
- (void)session:(DTiPhoneSimulatorSession *)session didStart:(BOOL)started withError:(NSError *)error {
|
||||||
|
if (started) {
|
||||||
|
// bring to front...
|
||||||
|
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
|
||||||
|
arguments:[NSArray arrayWithObjects:
|
||||||
|
@"-e", @"tell application \"System Events\"",
|
||||||
|
@"-e", @" set listOfProcesses to (name of every process where background only is false)",
|
||||||
|
@"-e", @"end tell",
|
||||||
|
@"-e", @"repeat with processName in listOfProcesses",
|
||||||
|
@"-e", @" if processName starts with \"iOS Simulator\" or processName starts with \"iPhone Simulator\" then",
|
||||||
|
@"-e", @" tell application processName to activate",
|
||||||
|
@"-e", @" end if",
|
||||||
|
@"-e", @"end repeat", nil]];
|
||||||
|
}
|
||||||
if (startOnly && session) {
|
if (startOnly && session) {
|
||||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
|
|
||||||
arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
|
|
||||||
msgprintf(@"Simulator started (no session)");
|
msgprintf(@"Simulator started (no session)");
|
||||||
[self doExit:EXIT_SUCCESS];
|
[self doExit:EXIT_SUCCESS];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (started) {
|
if (started) {
|
||||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
|
|
||||||
arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
|
|
||||||
int pid = [session simulatedApplicationPID];
|
int pid = [session simulatedApplicationPID];
|
||||||
if (shouldStartDebugger) {
|
if (shouldStartDebugger) {
|
||||||
char*args[4] = { NULL, NULL, (char*)[[[NSNumber numberWithInt:pid] description] UTF8String], NULL };
|
char*args[4] = { NULL, NULL, (char*)[[[NSNumber numberWithInt:pid] description] UTF8String], NULL };
|
||||||
|
Reference in New Issue
Block a user