{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/macaca/issues/654","repository_url":"https://api.github.com/repos/alibaba/macaca","labels_url":"https://api.github.com/repos/alibaba/macaca/issues/654/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/macaca/issues/654/comments","events_url":"https://api.github.com/repos/alibaba/macaca/issues/654/events","html_url":"https://github.com/alibaba/macaca/issues/654","id":245332089,"number":654,"title":"提供真机测试详细说明文档","user":{"login":"luozhang002","id":5653578,"avatar_url":"https://avatars0.githubusercontent.com/u/5653578?v=4","gravatar_id":"","url":"https://api.github.com/users/luozhang002","html_url":"https://github.com/luozhang002","followers_url":"https://api.github.com/users/luozhang002/followers","following_url":"https://api.github.com/users/luozhang002/following{/other_user}","gists_url":"https://api.github.com/users/luozhang002/gists{/gist_id}","starred_url":"https://api.github.com/users/luozhang002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luozhang002/subscriptions","organizations_url":"https://api.github.com/users/luozhang002/orgs","repos_url":"https://api.github.com/users/luozhang002/repos","events_url":"https://api.github.com/users/luozhang002/events{/privacy}","received_events_url":"https://api.github.com/users/luozhang002/received_events","type":"User","site_admin":false},"labels":[{"id":499721992,"url":"https://api.github.com/repos/alibaba/macaca/labels/Roadmap","name":"Roadmap","color":"fbca04","default":false},{"id":342312527,"url":"https://api.github.com/repos/alibaba/macaca/labels/help%20wanted","name":"help wanted","color":"159818","default":true},{"id":469002620,"url":"https://api.github.com/repos/alibaba/macaca/labels/iOS","name":"iOS","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":{"login":"Chan-Chun","id":17233599,"avatar_url":"https://avatars1.githubusercontent.com/u/17233599?v=4","gravatar_id":"","url":"https://api.github.com/users/Chan-Chun","html_url":"https://github.com/Chan-Chun","followers_url":"https://api.github.com/users/Chan-Chun/followers","following_url":"https://api.github.com/users/Chan-Chun/following{/other_user}","gists_url":"https://api.github.com/users/Chan-Chun/gists{/gist_id}","starred_url":"https://api.github.com/users/Chan-Chun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chan-Chun/subscriptions","organizations_url":"https://api.github.com/users/Chan-Chun/orgs","repos_url":"https://api.github.com/users/Chan-Chun/repos","events_url":"https://api.github.com/users/Chan-Chun/events{/privacy}","received_events_url":"https://api.github.com/users/Chan-Chun/received_events","type":"User","site_admin":false},"assignees":[{"login":"Chan-Chun","id":17233599,"avatar_url":"https://avatars1.githubusercontent.com/u/17233599?v=4","gravatar_id":"","url":"https://api.github.com/users/Chan-Chun","html_url":"https://github.com/Chan-Chun","followers_url":"https://api.github.com/users/Chan-Chun/followers","following_url":"https://api.github.com/users/Chan-Chun/following{/other_user}","gists_url":"https://api.github.com/users/Chan-Chun/gists{/gist_id}","starred_url":"https://api.github.com/users/Chan-Chun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chan-Chun/subscriptions","organizations_url":"https://api.github.com/users/Chan-Chun/orgs","repos_url":"https://api.github.com/users/Chan-Chun/repos","events_url":"https://api.github.com/users/Chan-Chun/events{/privacy}","received_events_url":"https://api.github.com/users/Chan-Chun/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2017-07-25T09:02:42Z","updated_at":"2018-04-03T09:31:16Z","closed_at":null,"author_association":"NONE","body":"# Macaca Ios真机调试文档\r\n\r\n1. 前期检查\r\n\r\n   必备：Ios真机、开发者账号（或者证书）、良好的数据线\r\n\r\n   其他：\r\n\r\n   * Ios真机信任此调试电脑\r\n   * Ios真机已注册进入开发者账号\r\n\r\n   - XCode version 9.0 and above.\r\n   - iOS version 11.0 and above. \r\n\r\n\r\n2. Macaca环境配置\r\n\r\n   参考[Macaca](https://macacajs.com/zh/environment-setup)配置环境页，配置Ios真机测试环境，步骤大致包括：\r\n\r\n   - 请安装 Xcode9 或者更高版本\r\n   - 请安装 [usbmuxd](https://github.com/libimobiledevice/usbmuxd) 以便于通过 USB 通道测试 iOS 真机\r\n\r\n   ```shell\r\n   $ brew install usbmuxd\r\n   ```\r\n\r\n   - 请安装 [ideviceinstaller](https://github.com/libimobiledevice/ideviceinstaller) 用来给真机安装 App。\r\n\r\n   ```shell\r\n   $ brew install ideviceinstaller\r\n   ```\r\n\r\n   - 应用中如含有 WebView，请安装 [ios-webkit-debug-proxy](https://github.com/google/ios-webkit-debug-proxy)\r\n\r\n   ```shell\r\n   $ brew install ios-webkit-debug-proxy\r\n   ```\r\n\r\n   - 请安装 [carthage](https://github.com/Carthage/Carthage) 来构建 Macaca [XCTestWD](https://github.com/macacajs/XCTestWD).\r\n\r\n   ```Shell\r\n   $ brew install carthage\r\n   ```\r\n\r\n   * 安装带TEAM_ID的Macaca-ios\r\n\r\n   ```shell\r\n   $ DEVELOPMENT_TEAM_ID=TEAM_ID npm i macaca-ios -g\r\n   ```\r\n\r\n   查看TEAM_ID的方法，确保已经有开发者账号（或者证书）的情况下，已经将XCTestWD安装到真机的情况下查看，TEAM_ID。在XCTestWD项目中如下可查看TEAM_ID：\r\n![6d308bd9gy1fg7cnt9hf6j20t70h7782](https://user-images.githubusercontent.com/17233599/37697212-7cb8049e-2d16-11e8-8817-3ac33fccac66.jpg)\r\n\r\n   * Macaca-doctor：用Macaca-doctor确保环境安装正确\r\n\r\n   ```shell\r\n   $ npm i macaca-cli -g\r\n   $ macaca doctor\r\n   ```\r\n\r\n3. 下载[XCTestWD](https://github.com/macacajs/XCTestWD)项目，并将其装入真机\r\n\r\n   * Carthage构建\r\n\r\n     ```shell\r\n     carthage update --platform iOS\r\n     ```\r\n\r\n   * XCTestWD安装，打开/XCTestWD/XCTestWD.xcodeproj\r\n\r\n     1. 导入开发者账号（证书）\r\n     2. Run Test将XCTestWDUITest装入真机：\r\n![1521611745508 2](https://user-images.githubusercontent.com/17233599/37697217-88e00366-2d16-11e8-9b4e-eaf1b693856c.jpg)\r\n\r\n4. 在测试脚本中配置真机测试参数\r\n\r\n   例子：\r\n<img width=\"563\" alt=\"2018-03-21 1 51 04\" src=\"https://user-images.githubusercontent.com/17233599/37697224-8d655ce2-2d16-11e8-8699-34e5b8e91fc1.png\">\r\n\r\n   * 如果真机中有相应的测试app，参数中`app` 可注释\r\n   * 确保udid对应真机已连入电脑，并信任此电脑\r\n   * 确保测试App bundle ID一致\r\n\r\n   \r\n\r\n5. 测试\r\n\r\n   例子:\r\n\r\n   ```shell\r\n   platform=ios macaca run --verbose --reporter macaca-reporter -d ./mobile-app-sample.test.js\r\n   ```\r\n\r\n   ​\r\n\r\n常见问题：\r\n\r\n* 提示有关ios-deploy找不到请安装[ios-deploy](https://github.com/phonegap/ios-deploy)\r\n\r\n  ```Shell\r\n  npm install -g ios-deploy\r\n  ```\r\n\r\n* xcode中如果提示XCTestWD.framwork找不到或出错，请删除XCTestWD.franwork重新执行Run Test\r\n![1521611745508](https://user-images.githubusercontent.com/17233599/37697228-92766f6e-2d16-11e8-890e-b867a0621e62.jpg)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alibaba/macaca/issues/comments/378188523","html_url":"https://github.com/alibaba/macaca/issues/654#issuecomment-378188523","issue_url":"https://api.github.com/repos/alibaba/macaca/issues/654","id":378188523,"user":{"login":"jinglv","id":12013318,"avatar_url":"https://avatars3.githubusercontent.com/u/12013318?v=4","gravatar_id":"","url":"https://api.github.com/users/jinglv","html_url":"https://github.com/jinglv","followers_url":"https://api.github.com/users/jinglv/followers","following_url":"https://api.github.com/users/jinglv/following{/other_user}","gists_url":"https://api.github.com/users/jinglv/gists{/gist_id}","starred_url":"https://api.github.com/users/jinglv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinglv/subscriptions","organizations_url":"https://api.github.com/users/jinglv/orgs","repos_url":"https://api.github.com/users/jinglv/repos","events_url":"https://api.github.com/users/jinglv/events{/privacy}","received_events_url":"https://api.github.com/users/jinglv/received_events","type":"User","site_admin":false},"created_at":"2018-04-03T09:31:16Z","updated_at":"2018-04-03T09:31:16Z","author_association":"NONE","body":"@lovexiaov 你好，非常感谢，根据的方法已解决"}}
{"actor":{"display_login":"jinglv"}}