是否可以通过终端打开UIAutomation
工具?
是否可以编写AppleScript
来打开Apple的UIAutomation
工具并加载要测试的应用程序?
您能否告诉我有什么办法可以通过脚本编写或通过命令行打开UIAutomation
并选择要测试的应用程序,以及选择测试脚本?
最佳答案
instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/\
PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>
对于xcode> = 4.5
instruments -t
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/\
AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>
对于xcode> = 6.1
instruments -w <device ID> -t \
/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/\
AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate \
<full_path_to_application> -e UIASCRIPT <path_to_script.js> \
-e UIARESULTSPATH <output_results_path>
不过,需要注意一些重要事项:
对于其他任何人,此路径可能有所不同,具体取决于您在模拟器上运行的iOS版本。还请记住将此路径用双引号引起来。
这些是我所缺少的要点,因此遇到了上面提到的一些错误。
关于iphone - 可以从命令行运行UI Automation工具吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4191945/