Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS real device 真机测试问题排查方案汇总 #948

Closed
paradite opened this issue Oct 18, 2019 · 1 comment
Closed

iOS real device 真机测试问题排查方案汇总 #948

paradite opened this issue Oct 18, 2019 · 1 comment
Assignees

Comments

@paradite
Copy link
Collaborator

paradite commented Oct 18, 2019

真机测试问题排查方案汇总,如果试了所有方案还有问题可以在这里回复。

English version below

已知问题和解决方法参见 #929

1 检查xctestwd

用Xcode确认一下xctestwd正确安装到了真机里,XCTextWDRunner 测试能正常运行

Screenshot 2019-10-18 at 2 02 31 PM copy

如图,确认:

  1. xctestwd的路径是报错信息里的xctestwd ,这里必须是你运行Macaca时用的xctestwd。如果你是项目里安装的Macaca(sample-nodejs里面的模式),就需要时项目目录 sample-nodejs/node_modules 里的xctestwd,如果你是全局安装的Macaca(npm i -g macaca-ios),就需要是全局目录 node_modules 里的xctestwd
  2. XCTestWDSetup->http://localhost:8001<-XCTestWDSetup 出现在log里

2 用macaca-sample提供的sample测试跑通流程

安装 ios-app-bootstrap 到真机 https://github.com/app-bootstrap/ios-app-bootstrap (bundleId需要手动改)
安装 sample-nodejs https://github.com/macaca-sample/sample-nodejs
改一下里面的 mobile-app-sample.test.js 配置:

var iOSOpts = {
  platformName: 'iOS',
  udid: 'abc', // 你的真机udid
  bundleId: 'xudafeng.ios-app-bootstrapabc', // 你的真机安装对应的bundleId
};

然后跑测试一下 npm run test:native 看是否能正常连接运行测试。

注意一下刚开始出现 Error: read ECONNRESET 是正常的,这里需要重新几次,等一会就好了:

Screenshot 2019-10-18 at 2 26 55 PM copy

3 删除老的,旧的依赖,重新安装

全局依赖:

npm uninstall -g macaca-ios
npm uninstall -g ...

npm i -g macaca-ios
npm i -g ...

当前目录的本地依赖:

npm uninstall macaca-ios
npm uninstall ...

npm i macaca-ios
npm i ...

注意看一下 xctestwd是否成功编译安装,如果不成功请创建新的 issue 反馈。


English version

Known issues and solutions: #929

Real test troubleshooting program summary, if you tried all the programs there are issues you can reply here.

1 Check xctestwd

Confirm with Xcode installed correctly what xctestwd to the real machine in, XCTextWDRunner test normal operation

Screenshot 2019-10-18 at 2 02 31 PM copy

As shown, confirm:

  1. xctestwd path information is given in the xctestwd that your test script uses. If you install macaca locally in your project or use sample-nodejs, it should be inside sample-nodejs/node_modules. If you install macaca globally (npm i -g macaca-ios), it should be in the global npm folder)
  2. XCTestWDSetup-> http: // localhost: 8001 <-XCTestWDSetup appear in the log in

2 sample test run through-flow provided by macaca-sample

Ios-app-bootstrap mounted to the real machine https://github.com/app-bootstrap/ios-app-bootstrap (bundleId need to manually change)
Installation sample-nodejs https://github.com/macaca-sample/sample-nodejs
The change inside the mobile-app-sample.test.js configuration:
var iOSOpts = { platformName: 'iOS', udid: 'abc', // your real machine udid bundleId: 'xudafeng.ios-app-bootstrapabc', // you install the corresponding real machine bundleId }; Then run the testnpm run test: native see whether the normal connection to run the test.

Note just began Error: read ECONNRESET is normal, there is need to re several times, wait a minute like:

Screenshot 2019-10-18 at 2 26 55 PM copy

3 Reinstall old depedencies

Global dependency:

npm uninstall -g macaca-ios
npm uninstall -g ...

npm i -g macaca-ios
npm i -g ...
Local dependency:

npm uninstall macaca-ios
npm uninstall ...

npm i macaca-ios
npm i ...
Pay special attention to whether xctestwd is built and installed successfully. If not, please create new issue with relevant information.

@paradite paradite pinned this issue Oct 18, 2019
@paradite paradite changed the title 真机测试问题排查方案汇总 iOS real device 真机测试问题排查方案汇总 Oct 18, 2019
@crrrrrrrrr

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants