Skip to content

Instantly share code, notes, and snippets.

@JohannesRudolph
Created April 10, 2013 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesRudolph/5353093 to your computer and use it in GitHub Desktop.
Save JohannesRudolph/5353093 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Launch application using ios-sim and set up environment to inject test bundle into application
# Source: http://stackoverflow.com/a/12682617/504494
if [ "$RUN_APPLICATION_TESTS_WITH_IOS_SIM" = "YES" ]; then
test_bundle_path="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION"
environment_args="--setenv DYLD_INSERT_LIBRARIES=/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection --setenv XCInjectBundle=$test_bundle_path --setenv XCInjectBundleInto=\"$TEST_HOST\""
testhost_dir=$(dirname "$TEST_HOST")
command="ios-sim launch '$testhost_dir' $environment_args --args -SenTest All '$test_bundle_path'"
eval $command
echo "Finished running tests with ios-sim"
else
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment