问题
When I tried to run my automation scripts through the terminal with Xcode 6 I got this error message:
WebKit Threading Violation - initial use of WebKit from a secondary thread.
Can someone help me to run the automation scripts through terminal or instrument in Xcode 6.
回答1:
I see the same message infrequently -- even when things run successfully.
You may be having troubles running instruments from command line because of changes to command line utilities for XCode 6.
Check out UIAutomation test invocation from the command line with Xcode 6
adding the -w flag made things work again for me. i.e.
-w "Resizable iPad (8.0 Simulator)"
Also, make sure you're passing the -w before the path to the app file:
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"
Here's a list of devices:
- Resizable iPad (8.0 Simulator)
- Resizable iPhone (8.0 Simulator)
- iPad 2 (7.1 Simulator)
- iPad 2 (8.0 Simulator)
- iPad Air (7.1 Simulator)
- iPad Air (8.0 Simulator)
- iPad Retina (7.1 Simulator)
- iPad Retina (8.0 Simulator)
- iPhone 4s (7.1 Simulator)
- iPhone 4s (8.0 Simulator)
- iPhone 5 (7.1 Simulator)
- iPhone 5 (8.0 Simulator)
- iPhone 5s (7.1 Simulator)
- iPhone 5s (8.0 Simulator)
- iPhone 6 (8.0 Simulator)
- iPhone 6 Plus (8.0 Simulator)
回答2:
I was facing the same issue , I resolved it by following steps :
Check ur UIAutomation is enabled or not in the device ? -> To check it , Go to settings -> Developer -> Enable UIAutomation
restart your device , and then again try. It works for me ... :)
来源:https://stackoverflow.com/questions/25919234/webkit-threading-violation-initial-use-of-webkit-from-a-secondary-thread-in-ui