- 安装Homebrew/Node/npm/cnpm/carthage 这些工具的安装参见 appium 环境搭建
- 安装相关工具
$ brew install usbmuxd $ brew install ios-webkit-debug-proxy
- 安装macaca命令行工具(集成了macaca doctor等命令)
$ cnpm i -g macaca-cli
- 驱动安装
$ cnpm i macaca-ios -g $ cnpm i macaca-android -g $ cnpm i macaca-chrome -g $ cnpm i macaca-electron -g
- 验证
$ macaca doctor
- Macaca在环境上做了相对严格的校验,如果有部分依赖安装不成功,会给出相应的提示,针对性解决即可
- xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
- 执行该命令即可:sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
使用macaca doctor验证环境时提示Not accepted Android SDK license agreements,解决方法:
找到环境变量中ANDROID_HOME
创建license
$ mkdir "/Users/.../Library/Android/sdk/licenses" $ echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "/Users/.../Library/Android/sdk/licenses/android-sdk-license" $ echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "/Users/.../Library/Android/sdk/licenses/android-sdk-preview-license"
再次使用macaca doctor检查