[RM-683] fix where `rake background_fetch=1' did not work with Xcode 6.x

http://hipbyte.myjetbrains.com/youtrack/issue/RM-683
This commit is contained in:
Watson
2014-12-14 21:31:17 +09:00
parent 828fa0ddc5
commit ebb6cddd7e
2 changed files with 14 additions and 2 deletions

2
NEWS
View File

@@ -2,6 +2,8 @@
* [iOS] Fixed a regression where wrong info.plist would be genrated wchich
related to Background Fetch.
* [iOS] Fixed a bug where `rake background_fetch=1' for background fetch would
not work with Xcode 6.x.
= RubyMotion 3.0 =

View File

@@ -1221,6 +1221,9 @@ lldb_run_command()
exit(1);
}
int pidNumber = ((int (*)(id, SEL))objc_msgSend)(session,
@selector(simulatedApplicationPID));
// Open simulator to the foreground.
if (!spec_mode) {
NSArray *ary = [NSRunningApplication runningApplicationsWithBundleIdentifier:
@@ -1234,12 +1237,19 @@ lldb_run_command()
[running_app activateWithOptions:
NSApplicationActivateIgnoringOtherApps];
}
else if (NSClassFromString(@"SimDevice")) {
// With Xcode 6.x, it moves app into background and sends `fetch' event for `background fetch'.
id messenger = ((id (*)(id, SEL))objc_msgSend)(session,
@selector(messenger));
((void (*)(id, SEL, int))objc_msgSend)(messenger,
@selector(backgroundAllApps:), pidNumber);
((void (*)(id, SEL, int))objc_msgSend)(messenger,
@selector(doFetchEventForPID:), pidNumber);
}
}
}
if (debug_mode == DEBUG_GDB) {
int pidNumber = ((int (*)(id, SEL))objc_msgSend)(session,
@selector(simulatedApplicationPID));
if (pidNumber == 0) {
fprintf(stderr, "*** Cannot get simulated application PID\n");
exit(1);