Appium Mac 命令行安装

Posted 数据科学工作加油站

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Appium Mac 命令行安装相关的知识,希望对你有一定的参考价值。

试过很多方法都失败,打算用命令行方式安装。

准备工作:

 从 https://github.com/appium/appium下载appium版本的源码(.tar)

 详见github_Appium1.6.5

1. 命令行安装node:

brew install node

 2. cd 到 appium.tar的解压后的路径

 3.  安装appium

npm install -g ./appium

 安装后界面:

nalideMacBook-Pro:appium-1.6.5 nali$ npm install -g appium
npm WARN deprecated babel[email protected]5.8.24: Babel 5 is no longer being maintained. Upgrade to Babel 6.
npm WARN deprecated [email protected]2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated line[email protected]0.2.0: Copy its ~20 LOC directly into your code instead.
/usr/local/bin/appium -> /usr/local/lib/node_modules/appium/build/lib/main.js

> [email protected]2.11.2 install /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js

info Chromedriver Install Installing Chromedriver version 2.28 for platform mac and architecture 64
info Chromedriver Install Opening temp file to write chromedriver_mac64 to...
info Chromedriver Install Downloading https://chromedriver.storage.googleapis.com/2.28/chromedriver_mac64.zip...
info Chromedriver Install Writing binary content to /var/folders/gs/1rvd4dj94gn10btdfzmq50680000gn/T/201787-9541-1hmuws9.6gxs/chromedriver_mac64.zip...
info Chromedriver Install Extracting /var/folders/gs/1rvd4dj94gn10btdfzmq50680000gn/T/201787-9541-1hmuws9.6gxs/chromedriver_mac64.zip to /var/folders/gs/1rvd4dj94gn10btdfzmq50680000gn/T/201787-9541-1hmuws9.6gxs/chromedriver_mac64
info Chromedriver Install Creating /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac...
info Chromedriver Install Copying unzipped binary, reading from /var/folders/gs/1rvd4dj94gn10btdfzmq50680000gn/T/201787-9541-1hmuws9.6gxs/chromedriver_mac64/chromedriver...
info Chromedriver Install Writing to /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver...
info Chromedriver Install /usr/local/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver successfully put in place

> [email protected]1.6.2 install /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver
> node ./bin/install.js

dbug androidDriver Getting Java version
info AndroidDriver Java version is: 1.8.0_144
info Selendroid Ensuring /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists

……

4.  命令行运行appium 检查是否能够启动

nalideMacBook-Pro:appium-1.6.5 nali$ appium
[Appium] Welcome to Appium v1.6.5
[Appium] Appium REST http interface listener started on 0.0.0.0:4723

5. 验证的第二种方式,安装appium-doctor.

   详见github_appium_doctor

  Appium 安装过程中也会遇到下面的error问题,但是不影响。后续解决

 

dbug AndroidDriver Getting Java version
info AndroidDriver Java version is: 1.8.0_144
info Selendroid Ensuring /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
info Selendroid Downloading Selendroid standalone server version 0.17.0 from http://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/0.17.0/selendroid-standalone-0.17.0-with-dependencies.jar --> /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server-7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82.jar
info Selendroid Writing binary content to /usr/local/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server.jar.tmp
ERR! Selendroid Error: bad SHA256 fingerprint: 33337a518022088f462d05787fbe6c757b8070b6a1022368163c5ddd6e817871 bytes: 5322043
ERR! Selendroid     at Object.wrappedLogger.errorAndThrow (../../lib/logging.js:63:13)
ERR! Selendroid     at downloadSelendroid$ (../../lib/installer.js:84:9)
ERR! Selendroid     at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! Selendroid     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
ERR! Selendroid     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
ERR! Selendroid     at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! Selendroid     at <anonymous>
ERR! Selendroid  Error: bad SHA256 fingerprint: 33337a518022088f462d05787fbe6c757b8070b6a1022368163c5ddd6e817871 bytes: 5322043
ERR! Selendroid     at Object.wrappedLogger.errorAndThrow (../../lib/logging.js:63:13)
ERR! Selendroid     at downloadSelendroid$ (../../lib/installer.js:84:9)
ERR! Selendroid     at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! Selendroid     at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
ERR! Selendroid     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
ERR! Selendroid     at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! Selendroid     at <anonymous>
Selendroid setup files did not yet exist, waiting...

 




以上是关于Appium Mac 命令行安装的主要内容,如果未能解决你的问题,请参考以下文章

基于Mac的Appium环境搭建(java)

Mac appium iOS 安装命令

全网最详细的Mac下搭建Appium环境文档,没有之一

Mac 下appium环境

Mac下appium ios自动化测试

Appium环境搭建python篇(mac系统)