2012-04-24 103 views
1

我无法从cmd行运行Instruments 4.3。我相信它正在采用我的旧4.2版本,它仍然安装。我如何获得仪器4.3安装和启动我的应用程序,然后运行UIAutomation反对它?从cmd行运行仪器4.3?

回答

2

问题是,您正在指定-w参数,但未提供设备ID。如果您尝试在模拟器中从您的应用运行,那么请忽略-w

xcrun instruments -v \ 
    -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \ 
    /Users/cliff/Src/MyApp/build/MyApp/Build/Products/Debug-iphoneos/MyApp.app \ 
    -e UIASCRIPT /Users/cliff/Src/MyApp/UIAutomation/automation-test.js \ 
    -e UIARESULTSPATH /Users/cliff/Src/MyApp/build/uiautomation 

如果你真的试图在设备上运行此脚本的自动化,那么你就可以迅速使用this script I wrote抢设备ID。将该ID输入到-w参数中,它应该可以正常工作。

+0

真棒剧本! – Cliff 2012-05-15 21:36:53

+0

工程就像一个魅力!再次感谢! – Cliff 2012-05-16 03:48:15

0

你尝试:/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/MacOS/Instruments

如何: /Applications/Xcode.app//Contents/Developer/usr/bin/instruments

+0

从包中打开应用程序。我想知道“instruments”cmd line命令在哪里,或者它现在已被弃用或者是什么。 – Cliff 2012-04-24 20:15:04

+0

哦,等等!我只是在偏好设置窗格中查看下载内容,似乎我还没有下载命令行工具! – Cliff 2012-04-24 20:16:27

+0

没有,也没有工作!我不断收到:“仪器使用错误:设备无法使用。” – Cliff 2012-04-24 20:19:08

1

我想我想通了这一点,但我仍然有问题。我从喜好安装命令行工具 - >下载并运行

xcode-select -switch /Applications/Xcode.app/Contents/Developer 

我然后跑:

xcrun instruments -v -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w /Users/cliff/Src/MyApp/build/MyApp/Build/Products/Debug-iphoneos/MyApp.app -e UIASCRIPT /Users/cliff/Src/MyApp/UIAutomation/automation-test.js -e UIARESULTSPATH /Users/cliff/Src/MyApp/build/uiautomation 

我敢肯定,这拾起的工具CMD线工具,因为我目前的版本我也将我的/ Developer文件夹移出了我的PATH。我卖的是不断收到:“仪器使用错误:设备无法使用。”那么是什么给了?