2014-09-18 35 views
3

當我試圖通過在Xcode 6的終端運行我的自動化腳本,我得到這個錯誤信息:WebKit的線程衝突 - 從UI自動化輔助線程初次使用的WebKit

WebKit Threading Violation - initial use of WebKit from a secondary thread. 

有人可以幫我在Xcode 6中通過終端或儀器運行自動化腳本。

+0

儀器錯誤? – Snowcrash 2015-03-07 12:47:14

+0

我在使用Appium進行測試時也遇到了這個問題。我認爲這是我的測試阻塞問題,但事實並非如此。我開始使用Appium的ios_webkit_proxy_launcher.js在iOS上對Safari進行測試,即使在日誌中仍然出現此錯誤,它也不會阻止測試。 – 2016-04-24 10:55:39

回答

1

即使事情成功運行,我也很少看到相同的消息。

你可能有運行的,因爲變化的命令行工具,以命令行實用程序的XCode 6.

退房UIAutomation test invocation from the command line with Xcode 6

添加-w標誌的麻煩讓事情再次爲我工作。即

-w "Resizable iPad (8.0 Simulator)" 

此外,還要確保你傳遞的-w路徑到應用程序文件之前:

instruments -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate" -w "iPad Air (8.0 Simulator)" "/path/to/My.app" -e UIASCRIPT "scriptola.js" 

這裏的設備列表:

  • 可調整大小的iPad 8.0(模擬器)
  • 可調整大小的iPhone(8.0模擬器)
  • iPad 2(7.1模擬器)
  • iPad 2的(8.0模擬器)
  • iPad的空氣(7.1模擬器)
  • iPad的空氣(8.0模擬器)
  • iPad的視網膜(7.1模擬器)
  • iPad的視網膜(8.0模擬器)
  • iPhone 4S( 7.1模擬器)
  • iPhone 4S(8.0模擬器)
  • iPhone 5(7.1模擬器)
  • iPhone 5(8.0模擬器)
  • iPhone 5S(7.1模擬器)
  • iPhone 5S(8.0模擬器)
  • iPhone 6(8.0模擬器)
  • iPhone 6加號(8.0模擬器)
0

我面臨同樣的問題,我通過以下步驟解決它:

檢查您的UIAutomation是否啓用或不在設備中? - >要檢查它,轉到設置 - >開發人員 - >啓用UIAutomation

重新啓動您的設備,然後再次嘗試。 它適用於我... :)