2017-01-23 15 views
2

TeamCityを使用してiOSアプリケーションの自動テストを設定しようとしています。現在、私のエージェントが構築したが、最後のターゲットを構築し、協調設計を実行したら、それは以下のハングと表示されます。シミュレータ起動時にxcodebuildがタイムアウトする

[19:29:34][CodeSign] CodeSign /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Build/Products/Debug-iphonesimulator/MyProductiOSUITests-Runner.app/PlugIns/MyProductiOSUITests.xctest 
[19:29:34][CodeSign]  cd /Users/ericmiller/.tcagent/work/f9abef315a0137d4 
[19:29:34][CodeSign]  export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate 
[19:29:34][CodeSign]  export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/ericmiller/.pyenv/shims:/Users/ericmiller/.rbenv/shims:/Users/ericmiller/.pyenv/shims:/Users/ericmiller/Scripts:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/local/bin" 
[19:29:34][CodeSign] Signing Identity:  "-" 
[19:29:34][CodeSign]  /usr/bin/codesign --force --sign - --timestamp=none /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Build/Products/Debug-iphonesimulator/MyProductiOSUITests-Runner.app/PlugIns/MyProductiOSUITests.xctest 
[19:29:34][CodeSign] /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Build/Products/Debug-iphonesimulator/MyProductiOSUITests-Runner.app/PlugIns/MyProductiOSUITests.xctest: replacing existing signature 
[19:31:32][CodeSign] 2017-01-22 19:31:32.279 xcodebuild[28262:86807] iOSSimulator: Timed out waiting 120 seconds for simulator to boot, current state is 1. 
[19:31:32][CodeSign] 2017-01-22 19:31:32.290 xcodebuild[28262:86805] iOSSimulator: Timed out waiting 120 seconds for simulator to boot, current state is 1. 
[19:31:32][CodeSign] 2017-01-22 19:31:32.291 xcodebuild[28262:86797] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSTests-2017-01-22_192932-E95vcV.log" UserInfo={NSLocalizedDescription=Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSTests-2017-01-22_192932-E95vcV.log} 
[19:31:32][CodeSign] 2017-01-22 19:31:32.291 xcodebuild[28262:86797] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSUITests-2017-01-22_192932-mrX7wQ.log" UserInfo={NSLocalizedDescription=Timed out waiting 120 seconds for simulator to boot, current state is 1. If you believe this error represents a bug, please attach the log file at /var/root/Library/Developer/Xcode/DerivedData/MyProductiOS-fgkoogiimhlbckdlbckzmqfyaoff/Logs/Test/89F7C786-9E91-419F-98CA-F36385618DC2/Session-MyProductiOSUITests-2017-01-22_192932-mrX7wQ.log} 

シミュレータアプリはドックで開かれています。シミュレータをクリックすると何も起こりませんが、右クリックしてウィンドウを選択すると、シミュレータが実際に動作していても何も表示されていないことがわかります。 Example

可能であれば、シミュレータではなく物理デバイスに切り替えることなく、コードをテストするための回避策を探しています。この目標を達成するにはどうすればよいでしょうか、設定に間違いがありますか?

編集:

Sven Driemeckerが解決策を見つけました。ここに私の設定です。 xcodebuildを実行する前に、以下のシェルスクリプトを実行して衛生的なテスト環境を確保します。

xcrun simctl shutdown %env.simulator_guid% 
killall Simulator 
killall com.apple.CoreSimulator.CoreSimulatorService 
xcrun simctl erase %env.simulator_guid% 

xcodebuildを実行しているときに、次のオプションを追加します

-destination "id=%env.simulator_guid%" 

をそして最後に、すべてをクリーンアップする:

xcrun simctl shutdown %env.simulator_guid% 
killall Simulator 
killall com.apple.CoreSimulator.CoreSimulatorService 

更新:はここで方法についてblog post I wroteですXCode/iOSの基本的なTeamCity CIを設定する

+0

レーダーを作成し、sysdiagnose -qの出力と〜/ Library/Logs/CoreSimulatorのログを含めてください。 – russbishop

答えて

1

これは非常に奇妙に思えますが、単にシミュレータをリセットするだけで通常これが修正されます。私たちはしばしば、私たち自身のCIシステムで同じエラーに遭遇します。

シミュレータメニュー - >コンテンツと設定のリセットを試してから、シミュレータを再起動してください。

これはコマンドラインで実行することができますが、ビルドを著しく遅くするので、お勧めしません。

+0

うわー!ありがとうございました!これは完全に機能しました。将来の訪問者を助けるために私が行ったことを正確に投稿します。 –

+0

あなたは大歓迎です! cmd行の自動化されたシミュレータのクリーニングは、私たちが以前試みたものと非常によく似ていますが、大きなパフォーマンス上の問題が発生しました。あなたのアプローチがかなり速いと聞いてうれしいです。それも試してみましょう! –

+0

当初思ったほど速くはありませんでした。それは私のビルド時間に4分を追加しました。しかし、これは私が唯一の開発者であり、ビルドマシンの注意が完全でないため、このプロジェクトでは受け入れられます。また、私はカルタゴを自動化したので、とにかくたくさんのものを作っています。また、比較的低速のマシンでもあり、2011年には少なくとも8MBのRAMとSSDを搭載しています。 –

関連する問題