Xcode 5からコマンドラインツールxcodebuildでテストの実行ができるようになったので、その指定方法を簡単に紹介します。
事前準備
まず、Xcodeからコマンドラインツールを入れておきます。
そして、ターミナル上でXcode 5が指定されていることを確認しましょう。
$ xcode-select --print-path /Applications/Xcode.app/Contents/Developer
Xcode4.appなどを返してくる場合には次のようにデフォルトパスを設定しなおすか、xcodebuildをフルパスで指定する必要があります。
$ sudo xcode-select --switch /Applications/Xcode.app
テストの実行
シミュレータ向けのテストでは次のように指定します
$ xcodebuild -project xcode5sample.xcodeproj \
-scheme xcode5sample \
-destination 'platform=iOS Simulator,name=iPhone Retina (3.5-inch),OS=7.0' \
test
オプション-destinationについては次のようになっているみたいです。
platformは、シミュレータの場合には「iOS Simulator」固定nameはハードウェア名を指定する。iOS Simulatorのメニュー → Hardware → Devideにある名前。スペースを含むことがあるので注意OSはバージョンを指定する。iOS Simulatorのメニュー → Hardware → Devide → 各デバイスにあるOSの数値部分
ちなみに、-schemeと-destinationのname部分はEdit Scheme…でも確認できます。
実行結果は次のようなかんじになります。
$ xcodebuild -project xcode5sample.xcodeproj -scheme xcode5sample -destination 'platform=iOS Simulator,name=iPhone Retina (3.5-inch),OS=7.0' test
2013-10-22 01:53:37.793 xcodebuild[22544:1207] [MT] DVTAssertions: Warning in /SourceCache/DTDeviceKit/DTDeviceKit-3693.1/DTDeviceKitBase/DTDeviceKitBase_Utilities.m:503
Details: Failed to register "/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/MobileDevices.bundle" with Launch Services, error code: -10811.
Function: __RegisterUTIsIfNeeded_block_invoke
Thread: <NSThread: 0x7f985840e5a0>{name = (null), num = 1}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
=== BUILD TARGET xcode5sample OF PROJECT xcode5s
:
:
** TEST SUCCEEDED **



0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。