2012-04-24 67 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。我賣的是不斷收到:「儀器使用錯誤:設備無法使用。」那麼是什麼給了?