gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 05:46:14 25 4
gpt4 key购买 nike

我正在尝试关注 this post从命令行在 iOS 设备上运行 UIAutomation 脚本,但我无法让它工作。

这是我目前使用的命令:仪器-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-iphonesimulator,在这种情况下它也忽略 -w),但是如果我使用为设备编译的应用程序启动它它崩溃(我尝试使用 release 和 debug ,我得到了相同的结果)。

我得到的错误是:

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.

最佳答案

我遇到了同样的错误,但我没有运行 Instruments 的多个副本。我通过将 -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>

关于ios - 使用设备上的仪器进行自动化测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12706508/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com