iOS 真机详细文档
Macaca Ios真机调试文档
-
前期检查
必备:Ios真机、开发者账号(或者证书)、良好的数据线
其他:
- Ios真机信任此调试电脑
- Ios真机已注册进入开发者账号
- XCode version 9.0 and above.
- iOS version 11.0 and above.
-
Macaca环境配置
参考Macaca配置环境页,配置Ios真机测试环境,步骤大致包括:
- 请安装 Xcode9 或者更高版本
- 请安装 usbmuxd 以便于通过 USB 通道测试 iOS 真机
$ brew install usbmuxd- 请安装 ideviceinstaller 用来给真机安装 App。
$ brew install ideviceinstaller- 应用中如含有 WebView,请安装 ios-webkit-debug-proxy
$ brew install ios-webkit-debug-proxy$ brew install carthage- 安装带TEAM_ID的Macaca-ios
$ DEVELOPMENT_TEAM_ID=TEAM_ID npm i macaca-ios -g查看TEAM_ID的方法,确保已经有开发者账号(或者证书)的情况下,已经将XCTestWD安装到真机的情况下查看,TEAM_ID。在XCTestWD项目中如下可查看TEAM_ID:

- Macaca-doctor:用Macaca-doctor确保环境安装正确
$ npm i macaca-cli -g $ macaca doctor -
下载XCTestWD项目,并将其装入真机
-
Carthage构建
carthage update --platform iOS -
XCTestWD安装,打开/XCTestWD/XCTestWD.xcodeproj
- 导入开发者账号(证书)
- Run Test将XCTestWDUITest装入真机:

-
-
在测试脚本中配置真机测试参数
例子:

- 如果真机中有相应的测试app,参数中
app可注释 - 确保udid对应真机已连入电脑,并信任此电脑
- 确保测试App bundle ID一致
- 如果真机中有相应的测试app,参数中
-
测试
例子:
platform=ios macaca run --verbose --reporter macaca-reporter -d ./mobile-app-sample.test.js
常见问题:
-
提示有关ios-deploy找不到请安装ios-deploy
npm install -g ios-deploy -
xcode中如果提示XCTestWD.framwork找不到或出错,请删除XCTestWD.franwork重新执行Run Test

谢谢
针对最新版Xcode,真机调试需要开发者证书 以后将会更新文档并且跟进IOS真机调试
我快被ios真机环境配置搞疯了。。。能先出个文档的预览版吗???
@Chan-Chun @xudafeng
@upengfei 预计三月中下旬在此issue中发布真机测试文档
@Chan-Chun 感谢!
xcode 9.2 iOS11 已经修改bundleId 但还是报错 BundleId XCTestWD.XCTestWD does not exist.
xctest-client.js:190:18 [master] pid:12160 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/[email protected]@xctestwd/XCTestWD/XCTestWD.xcodeproj xctest-client.js:276:14 [master] pid:12160 killing deviceLogProc pid: 12217 xctest-client.js:281:14 [master] pid:12160 killing runnerProc pid: 12203 xctest-client.js:201:16 [master] pid:12160 xctest client exit with code: 65, signal: null xctest-client.js:155:16 [master] pid:12160 devicelog exit with code: null, signal: SIGKILL xctest-client.js:268:14 [master] pid:12160 Fail to start xctest: undefined
谢谢Macaca官方团队的支持
先感谢Macaca团队的支持与贡献!
按照文档,配置好后,不过我这边还是一直提示:BundleId XCTestWD.XCTestWD does not exist.

用Xcode run XCTestWD时报错 /bin/sh: /Users/guanjihong/Library/Developer/Xcode/DerivedData/XCTestWD-evljajykmolwzobrozpobiggeeea/Build/Intermediates.noindex/XCTestWD.build/Debug-iphoneos/XCTestWDUITests.build/Script-7F6C3B601EFCD8AB00F53D6B.sh: No such file or directory
使用开发者证书后,我的开发者证书必须以com.开头 如何解决这个问题啊
你好,我在Run Test的时候,Build File报了很多错,如下图,请问是什么原因,谢谢!

@jinglv 这个是 Fuzi 库的问题,参考此 issue https://github.com/macacajs/XCTestWD/issues/122
@lovexiaov 你好,非常感谢,根据的方法已解决
XCTestWDUITests target, 执行Product>Test的之后,提示Build Success,但是Test Failed

xcode版本换成8.3后就运行正常了,应该是xcode版本不匹配导致的
@dbixia 这可能是动态库没找到导致的. 应该还是跟你本身的xcode 版本 以及carthage 相关依赖是否成功适配有关
@dbixia 请问你这个问题解决了吗?
This is the translated issue comment: @upengfei
@dbixia Can you solve this problem?
xcode9.4.1,ios11.4,XCTestWD真机,编译出错: 1.Use of undeclared type 'XCTestWDServer' 2.Use of unresolved identifier 'XCTestWDServer' @upengfei ,请看看是什么问题?急用,谢谢!
This is the translated issue comment: @wxlsh114
Xcode9.4.1, ios11.4, XCTestWD real machine, compile error: 1.Use of undeclared type 'XCTestWDServer' 2.Use of unresolved identifier 'XCTestWDServer' @upengfei, please see what is the problem? Urgent use, thank you!