Macaca inspector 从版本 25 之后更新都不好用,今天更新 29 依然不好使,只有 25 好使,为什么?报错如下

苏爱晴 · 2017年05月17日 · 最后由 qianzhong 回复于 2017年07月06日 · 4164 次阅读

命令:app-inspector -u emulator-5554
错误如下:
{ Error: Command failed: /Users/xxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 push /usr/local/lib/node_modules/app-inspector/node_modules/uiautomatorwd/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.macaca.android.testing

at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close as _onclose
killed: false,
code: 1,
signal: null,
cmd: '/Users/xxxx/Library/Android/sdk/platform-tools/adb -s emulator-5554 push /usr/local/lib/node_modules/app-inspector/node_modules/uiautomatorwd/app/build/outputs/apk/app-debug.apk /data/local/tmp/com.macaca.android.testing' }

共收到 18 条回复 时间 点赞

把手机里的 app-debug、com.macaca.android.testing 两个 app 删了再试试看

我的 ios 端报的是这种错呢。这是为啥呢?

server.js:16:12 [master] pid:1986 server start with config:
{ port: 5678,
verbose: true,
udid: 'ca4298c525bf8a8a5192d0e5c694a7a60a8cd048',
ip: '10.13.170.169',
host: 'bogon',
loaded_time: '2017-05-17 16:33:31' }
app-inspector.js:43:12 [master] pid:1986 server start at: http://10.13.170.169:5678
xctest-client.js:53:14 [master] pid:1986 project path: /usr/local/lib/node_modules/app-inspector/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
xctestwd start with port: 8001
xctest-client.js:226:14 [master] pid:1986 xcode version: 8.3.2
XCTestWD version: 1.0.12
xctest-client.js:38:14 [master] pid:1986 Uncaught Exception: ReferenceError: AGENT_URL_REG is not defined
xctest-client.js:257:14 [master] pid:1986 killing deviceLogProc pid: 1990
xctest-client.js:262:14 [master] pid:1986 killing runnerProc pid: 1993
xctest-client.js:268:14 [master] pid:1986 killing iproxyProc pid: 1992

你还好啦,我从来都没有好用过

我也遇到这个问题,我的解决方法如下,希望能帮到你
1.卸载 macaca 的 android 驱动和 app inSpector
npm uninstall macaca-android -g
npm uninstall app-inspector -g
npm cache clean

2.删除完成后,重新安装 android 驱动,保证出现 BUILD SUCCESSFUL 就可以了

3.驱动安装没有报错,再重新安装 appinspector
npm i app-inspector -g

我就是用这个方法解决的

cd /usr/local/lib/node_modules/app-inspector/node_modules/uiautomatorwd
./gradlew assembleDebug assembleDebugAndroidTest

报错说 apk 找不到,用上面 2 个命令 build apk 就可以了,已经在 android 上过了。

楼主问题解决了,请问哪个方案比较好呀,我也遇见了同样的问题。。

陈立兴 回复

用你的方法解决了,THX

陈立兴 回复

请问用哪两个命令 build apk 呢?

jiap 回复

用了这个方法试了,依然报之前的错误

深蓝 回复

还未解决呢,我目前用的 appium inspector 来查看 XPath,只是有时候需要用其他的元素控件时候 macaca 的 inspector 不能用还是干着急没办法

苏爱晴 回复

我现在貌似解决了。。

深蓝 回复

咋解决的?能否指教

苏爱晴 回复

你的其他环境没问题吧安卓 sdk 是否更新了

深蓝 回复

macaca doctor 检查全部正确且是最新

苏爱晴 回复

你现在是 2.0.6 吗

陈立兴 回复

zhongqiandeMacBook-Air:~ zhongqian$ cd /usr/local/lib/node_modules/app-inspector/node_modules/uiautomatorwd
zhongqiandeMacBook-Air:uiautomatorwd zhongqian$ ./gradlew assembleDebug assembleDebugAndroidTest
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /Users/zhongqian/android-sdk-macosx/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

A larger heap for the Gradle daemon is recommended for running jack.

It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB.
To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html

A larger heap for the Gradle daemon is recommended for running jack.

It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB.
To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html

Checking the license for package Android Support Repository in /Users/zhongqian/android-sdk-macosx/licenses
Warning: License for package Android Support Repository not accepted.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

    You have not accepted the license agreements of the following SDK components:
    [Android Support Repository].
    Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
    Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
我用你的命令会出错呢,能帮忙解决吗,谢谢~
Checking the license for package Android Support Repository in /Users/zhongqian/android-sdk-macosx/licenses
Warning: License for package Android Support Repository not accepted.

qianzhong 回复

android sdk manager 中安装了 Android Support Repository,就可用用命令构建包了,目前问题以解决~

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