次のコマンドを使用して、デバイス (シミュレーターではない) で iOS アプリを起動します (アプリは既にインストールされています)。
instruments \
-w c717fa22472d7b691ae5763af90e1e44244ad85a \
-t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
-D "/Users/mj/Desktop/apps/trace" \
LPSimpleExample-cal \
-e UIARESULTSPATH /Users/mj/Desktop/apps \
-e UIASCRIPT /Users/mj/Desktop/apps/_run_loop.js
10回のうち6回は機能しています。エラーの場合、次のメッセージが表示されます。
2013-10-07 16:45:51.553 instruments[9891:1207] unable to locate CFBundleIdentifier for path: LPSimpleExample-cal
2013-10-07 16:45:51.555 instruments[9891:1207] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Error Domain=com.apple.instruments Code=1 "Error Starting Recording" UserInfo=0x7faccbef8fa0 {NSLocalizedDescription=Error Starting Recording, NSLocalizedRecoverySuggestion=At least one target failed to launch; aborting run}
Instruments Trace Error : Failed to start trace.
私にとっては、楽器にバグがあるようです。さまざまなシナリオで 100 回以上アプリを起動しようとしましたが、エラー パターンを分析できません。デバイスのクラッシュログには次のように記載されています。
Process: DTMobileIS [34956]
Path: /Developer/Library/Daemons/DTMobileIS
Identifier: DTMobileIS
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: lockbot [34938]
Date/Time: 2013-10-07 15:29:05.474 -0700
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000
例外タイプEXC_BAD_ACCESS (SIGSEGV)
は、アクセスされているオブジェクトがすでに解放されていることを示します。ASIGSEGV
はセグメンテーション違反です。つまり、無効なメモリ アドレスにアクセスしようとしています。参照: iOS クラッシュ ログの例外の種類
bundleIdentifier を使用する代わりに、完全なアプリ パスまたは完全な bundleIdentifier も指定しようとしました。
# with full app path
instruments \
-w c717fa22472d7b691ae5763af90e1e44244ad85a \
-t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
-D "/Users/mj/Desktop/apps/trace" \
/Users/mj/Desktop/apps/LPSimpleExample-cal.app \
-e UIARESULTSPATH /Users/mj/Desktop/apps \
-e UIASCRIPT /Users/mj/Desktop/apps/_run_loop.js
# with full bundleIdentifier
instruments \
-w c717fa22472d7b691ae5763af90e1e44244ad85a \
-t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
-D "/Users/mj/Desktop/apps/trace" \
/Users/mj/Desktop/apps/LPSimpleExample-cal.app \
-e UIARESULTSPATH /Users/mj/Desktop/apps \
-e UIASCRIPT /Users/mj/Desktop/apps/_run_loop.js
構成の詳細
- 楽器のバージョン: 5.0 (51166)
- XCode バージョン: 5.0 (5A1413)
- デバイスの種類: iPhone 5 - 6.1.3、iPhone 5C - 7.02、iPhone 5S - 7.0.2
楽器がデバイスでアプリを起動できない場合や、エラーメッセージが表示される場合の詳細情報はありますunable to locate CFBundleIdentifier for path: LPSimpleExample-cal
か?