[Bamboo Knowledge Base]
Xcode support is undergoing testing and as such is unsupported by Atlassian at this time. If you would like to see it officially supported, please vote for this improvement request.
brew install ios-sim
. For other installation methods, see the ios-sim website.Podfile
in your project) – Cocoapods is the library dependency manager for Mac OS X. In order for Bamboo to install dependencies from your Podfile (if you have created one), Bamboo will need it installed on all systems where the build should run.To have tests automatically run on the iOS Simulator and reported within Bamboo you must make some changes to your Xcode project's test bundles and add the Xcode build task to your Job within Bamboo.
Without modifications, Apple does not support running unit tests in the simulator using the xcodebuild
terminal utility which Bamboo uses to automate builds and tests.
Using ios-sim and a small modification to the RunUnitTests script phase in the test bundle its possible to overcome this limitation.
Change the content of the script to:
if [ "$RUN_UNIT_TEST_WITH_IOS_SIM" = "YES" ]; then test_bundle_path="$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.$WRAPPER_EXTENSION" ios-sim launch "$(dirname "$TEST_HOST")" --setenv DYLD_INSERT_LIBRARIES=/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection --setenv XCInjectBundle="$test_bundle_path" --setenv XCInjectBundleInto="$TEST_HOST" --args -SenTest All "$test_bundle_path" echo "Finished running tests with ios-sim" else "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" fi
To configure a Xcode to test an iOS project task:
Complete the following settings:
Task Description | A description of the task, which is displayed in Bamboo. |
Disable this task | Check, or clear, to selectively run this task. |
Apple SDK | The Apple SDK to target during the build. |
Report test results | Report and store any OCUnit/SenTestKit results run during the build. |
Run tests in iOS simulator | Provides the RUN_UNIT_TEST_WITH_IOS_SIM variable used in the custom build phase to run the unit tests on the simulator. |
When you upgrade Xcode you may need to update Bamboo with the correct SDK information.
If you use local agents:
If you are using remote agents:
xcode-build -showsdks
from the command line