aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xUnitTesting/RunIPhoneUnitTest.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/UnitTesting/RunIPhoneUnitTest.sh b/UnitTesting/RunIPhoneUnitTest.sh
index 69d3d8c..7721fcd 100755
--- a/UnitTesting/RunIPhoneUnitTest.sh
+++ b/UnitTesting/RunIPhoneUnitTest.sh
@@ -116,6 +116,11 @@ if [ "$PLATFORM_NAME" == "iphonesimulator" ]; then
fi
if [ $GTM_DISABLE_IPHONE_LAUNCH_DAEMONS -eq 0 ]; then
+ # Remove any instance of RunIPhoneLaunchDaemons left running in the case the
+ # 'trap' below fails. We first must check for RunIPhoneLaunchDaemons'
+ # presence as 'launchctl remove' will kill this script if run from within an
+ # Xcode build.
+ launchctl list | grep RunIPhoneLaunchDaemons && launchctl remove RunIPhoneLaunchDaemons
# If we want to test anything that interacts with the keychain, we need
# securityd up and running. See RunIPhoneLaunchDaemons.sh for details.
launchctl submit -l RunIPhoneLaunchDaemons -- "${ScriptDir}/RunIPhoneLaunchDaemons.sh" $IPHONE_SIMULATOR_ROOT $CFFIXED_USER_HOME