Xcode

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

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.

 

要件

  • Apple Xcode 4 – or later version
  • Certificates and provisioning profiles – You must install all required developer certificates and provisioning profiles on every machine that Bamboo will use to run your build. See the App Distribution Guide for more information.
  • Bamboo Xcode support plugin –  The latest Xcode plugin installed in your Bamboo server.
  • ios-sim (optional when building Mac applications) – a command line utility used to launch the iOS Simulator from the command line. If you have homebrew installed, you can install it by running brew install ios-sim. For other installation methods, see the ios-sim website.
  • Cocoapods (optional if you do not have a 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.

Testing iOS applications

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.

Configuring your Xcode project automated simulator tests

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

Configuring the Xcode task for testing

To configure a Xcode to test an iOS project task:

  1. ジョブのタスク設定タブに移動します(新しいプランを作成するとデフォルト ジョブとなります)。
  2. Click the name of an existing Xcode task, or click Add Task then Xcode to create a new task.
  3. 以下の設定を行います。
     

    タスクの説明 タスクの説明。これは Bamboo で表示されます。
    このタスクを無効化 オンまたはオフにすることで、選択的にこのタスクを実行します。
    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.
  4. 保存をクリックします。

Updating the available SDKs when Xcode is upgraded

When you upgrade Xcode you may need to update Bamboo with the correct SDK information.

If you use local agents:

  1. Login as an administrator
  2. Go to Administration -> Server Capabilities
  3. Click Detect server capabilities

If you are using remote agents:

  1. Run xcode-build -showsdks from the command line
  2. Login as an administrator
  3. In Administration -> Agents, pick the agent you wish for the new SDK capability to be present on
  4. Click Add Capability and pick Xcode SDK from the Capability Type field
  5. Set a name for the SDK (e.g. OS X 10.9)
  6. Set a SDK label (e.g. macosx10.9)

 

 

最終更新日 2017 年 1 月 20 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.