加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 使用设备上的仪器进行自动化测试

发布时间:2020-12-14 17:31:36 所属栏目:百科 来源:网络整理
导读:我试图遵循 this post从命令行在iOS设备上运行UIAutomation脚本,但我无法使其工作. 这是我目前使用的命令: instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resourc
我试图遵循 this post从命令行在iOS设备上运行UIAutomation脚本,但我无法使其工作.

这是我目前使用的命令:
instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate / Users / X / Library / Developer / Xcode / DerivedData / TestiPhoneAutomation2-dyufpxsavtdqkybpagcoawdudzid / Build / Products / Debug-iphoneos / TestiPhoneAutomation2.app -e UIASCRIPT“/Users/X/Workspaces/TestiPhoneAutomation/test2.js”-e UIARESULTSPATH“/ Users / X / Workspaces / TestiPhoneAutomation2 /”-w 80bf5b … UDID. ..dfb52543 -v

它在模拟器上运行良好(通过Debug-iphonesimulator替换Debug-iphoneos,它在这种情况下也忽略了-w),但是如果我使用为设备编译的应用程序启动它它会崩溃(我尝试使用发布和调试,我得到相同的结果).

我得到的错误是:

posix spawn failure; aborting launch (binary ==
/Users/X/Library/Developer/Xcode/DerivedData/TestiPhoneAutomation2-dyufpxsavtdqkybpagcoawdudzid/Build/Products/Debug-iphoneos/TestiPhoneAutomation2.app/TestiPhoneAutomation2).
2012-10-03 12:10:36.609 instruments[76151:1603] Recording cancelled :
At least one target failed to launch; aborting run Instruments Trace
Error : Failed to start trace.

解决方法

我得到了同样的错误,但我没有运行多个仪器副本.我通过在应用程序之前放置-w UDID参数,并且仅使用应用程序的名称(已将应用程序部署到设备)来实现此功能.

我使用的命令行如下(使用Xcode 4.6):

instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w <device_id> <app_name> -e UIASCRIPT <path_to_script> -e UIARESULTSPATH <path_to_results>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读