Macaca macaca 跑起来后,安装到 iOS 上的 WD 闪退问题。

sixleaves · 2016年10月10日 · 最后由 志雄 回复于 2016年11月29日 · 1907 次阅读

在测试 macaca,碰到这个问题被卡半天。首先我手机上已经有了 WD。也有待测试的 app,是我自己打包安装的 app。
所以我用 python 写的脚本如下, 想看看用 macaca 能否正常启动名为 com.netdragon.quicktest 的包。

结果还是不行,一运行,会先打开 WD,然后没一会 WD 就闪退。并给出如下截图的提示。不知道是哪里有问题。
真是蛋疼。求解释

共收到 23 条回复 时间 点赞

#1 楼 @xdf 可以,但这跑的不是 iOS 上的程序啊。

环境是 XCode8.0

真是蛋疼的框架,我还是折腾 appium 去,

#5 楼 @xdf 什么东西。。。这个网址里的下载下来的是 macaca-test-sample 啊?不明白有什么指示。。。

模拟器跑 macaca run -d macaca-mobile-sample.test.js 是没问题的啊啊啊啊啊 @xdf

把 runner 重签名后,发现安装上去的包名还是 com.apple.test.WebDriverAgentRunner-Runner。但是已经改了 Bundle ID 了, 求指导 @xdf

#10 楼 @wang04170 好像也不是闪退, 我看模拟器运行也是这样, 先打开 WD,然后退出。再打开应用,开始测试。问题是我现在到打开应用这不就萎了。。

不跑脚本的话,手动在设备上开 WebDriverAgent 的话是能打开到黑色屏的界面,还是就闪退了?

#12 楼 @wang04170 可以打开。

#12 楼 @wang04170 打开到黑屏,不闪退

你看下错误 LOG 是不是提示 Could not start service com.apple.syslog_relay,如果是需要重新安装 brew reinstall --HEAD libimobiledevice,再执行:sudo chmod 777 /var/db/lockdown。

#15 楼 @wang04170 还真有这个。不过不止这一个。

>> xctest-client.js:156:14 [master] pid:8555 2016-10-10 17:54:54.560 xcodebuild[11227:182762] Error Domain=IDEFoundationErrorDomain Code=3 "The device cannot run executables for arm64." UserInfo={NSLocalizedDescription=The device cannot run executables for arm64., NSLocalizedRecoverySuggestion=The device does not support the architecture of the selected executable. Switch to a device that supports arm64.}

>> xctest-client.js:156:14 [master] pid:8555 2016-10-10 17:54:54.560 xcodebuild[11227:182762] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

>> xctest-client.js:156:14 [master] pid:8555
Testing failed:

>> xctest-client.js:156:14 [master] pid:8555    Run test suite UITestingUITests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
Failing tests:
        -[UITestingUITests testRunner]
** TEST FAILED **


>> xctest-client.js:164:14 [master] pid:8555 xctest client exit with code: 65, signal: null
>> xctest-client.js:123:16 [master] pid:8555 ERROR: Could not start service com.apple.syslog_relay.

#16 楼 @wang04170 还是不行。
提示什么 Error Domain

>> xctest-client.js:156:14 [master] pid:8555 2016-10-10 19:35:00.125 xcodebuild[21725:224860] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}

>> xctest-client.js:156:14 [master] pid:8555
Testing failed:

>> xctest-client.js:156:14 [master] pid:8555    Test target Runner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted)
** TEST FAILED **


>> xctest-client.js:164:14 [master] pid:8555 xctest client exit with code: 65, signal: null
>> xctest-client.js:156:14 [master] pid:8555 Failing tests:

>> xctest-client.js:156:14 [master] pid:8555    -[UITestingUITests testRunner]
** TEST FAILED **


>> xctest-client.js:164:14 [master] pid:8555 xctest client exit with code: 65, signal: null

QQ 群号:287162474

@sixleaves -。-那貌似也不太看得出问题在哪了,建议你试下把 WDA 的源码去 github 上下载下来,然后把 Lib 和 Runner 都重签名后,用 XCode 编译后确认在设备上跑起来,运行后确认下 xxx.xxx.xxx.xxx:8100/inspector 可以正常访问,然后把签名后的 WDA 源码替换到 xctest-client 的 node_modules 下的 webdriveragent 里,然后再跑一次试试。

#20 楼 @wang04170 签名后的 WDA 源码?签名是针对二进制文件和其它资源文件的啊,你说的是签名完后的.app 拷贝到 xctest-client 的 node_modules 下吧。

是整个源码,包含.xcodeproj 文件的,放到/usr/local/lib/node_modules/macaca-ios/node_modules/xctest-client/node_modules/webdriveragent/WebDriverAgent ,macaca 执行的时候会去编译和安装它到设备。

请问我这边跑起来 WD 但是看不到他跑我的软件 这个问题怎么解决

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册