diff options
author | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2014-09-18 14:27:43 +0200 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2014-09-23 12:08:15 +0200 |
commit | 92f94ab4b1cc49d2c4a1a3eb2184c65fb7793f0a (patch) | |
tree | af8cde4014b0fae6e17ef4e16e87b781bacb7e10 | |
parent | 4d12c017de5cf452480d6a627c927ae8c4278300 (diff) |
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>
-rw-r--r-- | src/tools/3rdparty/iossim/iphonesimulator.mm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/tools/3rdparty/iossim/iphonesimulator.mm b/src/tools/3rdparty/iossim/iphonesimulator.mm index 7845a7af46..0e75fc51a9 100644 --- a/src/tools/3rdparty/iossim/iphonesimulator.mm +++ b/src/tools/3rdparty/iossim/iphonesimulator.mm @@ -261,16 +261,25 @@ static void ChildSignal(int /*arg*/) { } - (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) { - [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript" - arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]]; msgprintf(@"Simulator started (no session)"); [self doExit:EXIT_SUCCESS]; return; } if (started) { - [NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript" - arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]]; int pid = [session simulatedApplicationPID]; if (shouldStartDebugger) { char*args[4] = { NULL, NULL, (char*)[[[NSNumber numberWithInt:pid] description] UTF8String], NULL }; |