使用xcodebuild运行自定义框架测试用例时iOS物理设备报错求助
iOS物理设备运行自定义框架测试用例报错排查
我在iOS物理设备上运行自定义框架的测试用例时遇到错误,执行的xcodebuild命令如下:
xcodebuild \ -scheme Automation \ -destination'generic/platform=iOS' \ test
错误信息如下:
测试失败:
运行目标“My Device”对运行“Automation” scheme无效。
“Automation” scheme不包含任何测试目标。
解决办法
- 检查
Automationscheme配置:打开Xcode,进入「Edit Scheme」,确认「Tests」标签页下已添加对应的测试目标 - 修改
xcodebuild命令的destination参数:针对物理设备,不能使用generic/platform=iOS,需指定具体设备的UDID或名称,示例:
或使用设备名称(需确保设备已连接并被Xcode识别):xcodebuild -scheme Automation -destination 'platform=iOS,id=你的设备UDID' testxcodebuild -scheme Automation -destination 'platform=iOS,name=你的设备名称' test - 确认物理设备连接状态:在Xcode的「Window > Devices and Simulators」中检查设备是否被正常识别,且已完成信任设置
内容的提问来源于stack exchange,提问作者Akshay
相关产品推荐
相关产品推荐

