From 04bc0422236eb724f0bb432c8b4936abcc24b9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Mon, 3 Mar 2014 15:39:09 +0100 Subject: [PATCH] [sim] Don't make the sim app active when `background_fetch=1`. --- bin/sim.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/sim.m b/bin/sim.m index 6c122575..e271eda3 100644 --- a/bin/sim.m +++ b/bin/sim.m @@ -1213,9 +1213,13 @@ lldb_commands_file(int pid, NSString *app_path) @"com.apple.iphonesimulator"]; if ([ary count] == 1) { running_app = [ary[0] retain]; - // TODO activate when launching with background_fetch=1 ? - [running_app activateWithOptions: - NSApplicationActivateIgnoringOtherApps]; + // When launching in ‘background fetch’ mode, most users will log + // debug output, only a few apps will update the UI (icon badge + // or local notification). + if (getenv("background_fetch") == NULL) { + [running_app activateWithOptions: + NSApplicationActivateIgnoringOtherApps]; + } } }