更新Appium1.7.1到1.8.1
1. 命令行更新appium可能需要翻牆
2. 直接用命令:sudo npm install -g appium會出現錯誤:
Error: EACCES: permission denied, mkdir '/usr/local/n/versions/node/10.4.0/lib/node_modules/appium/node_modules/appium-chromedriver/201858-3907-hybcas.w91wc'
更新appium命令換成下面的避免以上錯誤:
$ sudo npm install -g appium --unsafe-perm=true --allow-root
3. 錯誤信息:python2: command not found
stack Error: Command failed: /user/path/.pyenv/shims/python2 -c import platform; print(platform.python_version());
stack pyenv: python2: command not found
解決辦法:用python2所在目錄下的python2可執行文件替換在/user/path/.pyenv/shims目錄下的python2。
需要用到python2命令,確保python2能正常執行
$ python2
Python 2.7.13 (default, Jul 19 2017, 17:41:39)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
4. 檢查appium是否安裝成功:
$ sudo npm install appium-doctor -g
$ appium-doctor
5. 重新安裝依賴
$ brew upgrade Carthage
$ brew unlink libimobiledevice
$ brew install libimobiledevice --HEAD
$ brew install ios-deploy
$ gem install xcpretty
6. 更新XCUItest driver - WebDriverAgent
官網下載最新的WebDriverAgent:https://github.com/facebook/WebDriverAgent
將文件夾覆蓋原來的WebDriverAgent,自動簽名/手動簽名參照:https://blog.csdn.net/yinshuilan/article/details/80626314