简体   繁体   中英

instruments automation command not working , when executed twice in terminal. i am using xcode 6.1.1

I am using the following command in terminal to trigger my simulator.

instruments -w 'iPhone 5s' -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate <app file path> -e UIASCRIPT <script path> -e UIARESULTSPATH <testreport path>

For the first time it is working , but when i try to run it the second time in the same terminal window it is throwing the following errors.

Instruments Trace Error : Target failed to run: The operation couldn't be completed. (FBSOpenApplicationErrorDomain error 8.) : Failed to launch process with bundle identifier "com.xxx.yyy"

and also soemtimes the error

Instruments Trace Error : Target failed to run: The operation couldn't be completed. (FBSOpenApplicationErrorDomain error 4.)

Here is my code for running instruments using command line, note that this code is for real devices (TestAutomator is the name of the app, no need to add .ipa):

instruments -w 'fa10dec83c62a571a9691b5d9ef24cc68de73bf0' \
-t '/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate' \
 TestAutomation \
-e UIASCRIPT '/Users/roykronenfeld/Desktop/Automation.js' \
-e UIARESULTSPATH '/Users/roykronenfeld/Desktop‘ 

And here is a working version for simulator:

instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate "/Users/JOHN/Library/Application Support/iPhone Simulator/7.1/Applications/B9812A59-EBE4-454E-B910-B2969B4D3702/TestApp.app" -e UIASCRIPT ./Tests.js

I encountered this same error via an Appium run, which wraps Instruments.

For me, the fix was:

  1. XCode > Projects > (My Project) > General
  2. In the Identity section, I found errors with my ID and Certificate. I used Xcode prompts to fix both.
  3. (Appium specific) Confirm node is installed.

检查项目的标志信息。通常,警告消息表示仪器无权在设备上运行目标应用程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM