Commit 58b98b03 authored by Fawzi Mohamed's avatar Fawzi Mohamed

iossim: bring simulator to front

Change-Id: Ia52237760d36f342d6b053525ca6617a1e722aab
Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
parent d06fb9cf
......@@ -19,7 +19,7 @@ LIBS += \
-framework ApplicationServices \
-framework CoreFoundation \
-F/System/Library/PrivateFrameworks \
-framework IOKit
-framework IOKit -framework AppKit
iPhoneSimulatorRemoteClientDirectLinking {
LIBS += \
......
......@@ -22,7 +22,8 @@ QtcTool {
]
cpp.linkerFlags: base.concat(["-sectcreate", "__TEXT", "__info_plist", path + "/Info.plist",
"-fobjc-link-runtime"])
cpp.frameworks: base.concat(["Foundation", "CoreServices", "ApplicationServices", "IOKit"])
cpp.frameworks: base.concat(["Foundation", "CoreServices", "ApplicationServices", "IOKit",
"AppKit"])
cpp.frameworkPaths: base.concat("/System/Library/PrivateFrameworks")
toolInstallDir: project.ide_libexec_path + "/ios"
......
......@@ -11,6 +11,7 @@
#import <sys/types.h>
#import <sys/stat.h>
#import <objc/runtime.h>
#import <AppKit/NSRunningApplication.h>
NSString *simulatorPrefrencesName = @"com.apple.iphonesimulator";
NSString *deviceProperty = @"SimulateDevice";
......@@ -123,11 +124,15 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
- (void)session:(DTiPhoneSimulatorSession *)mySession didStart:(BOOL)started withError:(NSError *)error {
if (startOnly && mySession) {
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
nsprintf(@"<msg>Simulator started (no session)</msg>");
[self doExit:EXIT_SUCCESS];
return;
}
if (started) {
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/osascript"
arguments:[NSArray arrayWithObjects:@"-e", @"tell application \"iPhone Simulator\" to activate", nil]];
if (shouldStartDebugger) {
char*args[4] = { NULL, NULL, (char*)[[[mySession simulatedApplicationPID] description] UTF8String], NULL };
if (useGDB) {
......@@ -151,12 +156,12 @@ NSString *deviceIpadRetina = @"iPad (Retina)";
if (verbose) {
nsprintf(@"<msg>Session started</msg>");
}
nsprintf(@"<inferior_pid>%@</inferior_pid>", [session simulatedApplicationPID]);
fflush(stdout);
if (exitOnStartup) {
[self doExit:EXIT_SUCCESS];
return;
}
nsprintf(@"<inferior_pid>%@</inferior_pid>", [session simulatedApplicationPID]);
fflush(stdout);
pidCheckingTimer = [[NSTimer scheduledTimerWithTimeInterval:5.0 target:self
selector:@selector(checkPid:) userInfo:nil repeats: TRUE] retain];
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment