Macaca TypeError: _.uuid is not a function

keith · May 09, 2017 · Last by 小马 replied at May 11, 2017 · 2031 hits

$ macaca server -p 3456

responseHandler.js:54:12 [master] pid:1777 Send Error Respone to Client: TypeError: _.uuid is not a function
responseHandler.js:60:14 [master] pid:1777 TypeError: _.uuid is not a function



共收到 12 条回复 时间 点赞

我也是碰到了这个问题,应该是在 升级 macaca-android@2.0.0 之后出现的! 这个好处理! 找到报错的代码中 uuid 将后面的 括号去掉即可!
cannot stat '/usr/local/lib/node_modules/.app-inspector_npminstall/node_modules/.1.0.2@uiautomatorwd/app/build/outputs/apk/app-debug.apk': No such file or directory
应该是下面的原因: Macaca doctor 中提示!
Command Line Tools: gradle is uninstalled


keith #3 · May 09, 2017 作者


keith #4 · May 09, 2017 作者

重新npm i -g macaca-cli 全局更新就好了吗

  1. 下载:gradle 最新版本!

  2. 安装
    Linux & MacOS users
    Unzip the distribution zip file in the directory of your choosing, e.g.:
    $ mkdir /opt/gradle
    $ unzip -d /opt/gradle
    $ sudo chmod 775 /opt/gradle/
    $ ls /opt/gradle/gradle-3.5
    LICENSE NOTICE bin getting-started.html init.d lib media

3.Step 3. Configure your system environment
Linux & MacOS users
Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:
$ export PATH=$PATH:/opt/gradle/gradle-3.5/bin

再重装 cnpm i macaca-android -g

$ cnpm i macaca-android -g

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 SDK Build-Tools 25.0.2, Android SDK Platform 23].
    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

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


Total time: 2.342 secs
(node:70253) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: build failed
Checking the license for package Android SDK Build-Tools 25.0.2 in /Users/caolinming/tools/sdk/licenses
Warning: License for package Android SDK Build-Tools 25.0.2 not accepted.
Checking the license for package Android SDK Platform 23 in /Users/caolinming/tools/sdk/licenses
Warning: License for package Android SDK Platform 23 not accepted.

keith #7 · May 09, 2017 作者


Error:connect ECONNREFUSED

升级新版本后,报错,之后查看macaca doctor 提示 没有安装gradle ,请根据 执行安装这个工具

1、sdk install gradle 3.5
2、brew install gradle

$ android sdk

安装 Android SDK Build-Tools 25.0.2

1 保证android-sdk build-tools 25.0.2 安装android support repository
2 gradle 配置正常

3 npm uninstall macaca-android -g
npm cache clean
cd /tmp
sudo rm -rf npm*

4 再npm i macaca-android -g 保证安装日志都是build successful

5 保证 安装完macaca-android后 有这个文件 node-global\node_modules\macaca-android\node_modules\uiautomatorwd\app\build\outputs\apk\app-debug.apk

6 再安装app-inspector 就OK了


需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up