1. 程式人生 > >(乾貨分享)mac python+appium環境搭建

(乾貨分享)mac python+appium環境搭建

因為mac本自帶python2.x(不建議解除安裝,因為本本本身有很多依賴與此),所以裝python3的過程極其坎坷,勉強裝好後也總是各種報錯。這次裝appium環境,直接把原來的python3卸了,用homebrew安裝。建議大家也用這個安裝吧,簡單而且錯誤率低。 --brew的安裝命令: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 下面進入正題,mac python+appium環境搭建: 2、下載安裝android sdk 、JDK【附上地址,具體安裝及後續配置可自行百度】 android sdk下載地址:http://tools.android-studio.org/index.php/sdk?spm=a2c4e.11153940.blogcont593549.13.4f164466N7mmUH 特別注意❗️環境變數配置:vim ~/.bash_profile 配置好環境變數記得執行:source ~/.bash_profile ,不然可能不生效 啟動android下載相關元件:sdk資料夾中的tools-android 3、安裝appium及appium doctor:
  • brew命令安裝node:brew install node
  • npm命令安裝appium:npm install -g appium
安裝好appium後在終端輸入appium,如果出現如下介面說明安裝成功 yoyodeMacBook-Pro:~ mac$ appium [Appium] Welcome to Appium v1.9.1 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 安裝好appium後在終端輸入appium-doctor,如果出現如下介面說明安裝成功 Last login: Thu Oct 18 11:51:18 on ttys000 yoyodeMacBook-Pro:~ mac$ appium-doctor info AppiumDoctor Appium Doctor v.1.6.0 info AppiumDoctor ### Diagnostic starting ### info AppiumDoctor  ✔ The Node.js binary was found at: /usr/local/bin/node info AppiumDoctor  ✔ Node version is 10.12.0
info AppiumDoctor  ✔ Xcode is installed at: /Library/Developer/CommandLineTools info AppiumDoctor  ✔ Xcode Command Line Tools are installed. info AppiumDoctor  ✔ DevToolsSecurity is enabled. info AppiumDoctor  ✔ The Authorization DB is set up properly. info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage info AppiumDoctor  ✔ HOME is set to: /Users/mac info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/mac/Downloads/android-sdk-macosx info AppiumDoctor  ✔ JAVA_HOME is set to: //Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home info AppiumDoctor  ✔ adb exists at: /Users/mac/Downloads/android-sdk-macosx/platform-tools/adb info AppiumDoctor  ✔ android exists at: /Users/mac/Downloads/android-sdk-macosx/tools/android info AppiumDoctor  ✔ emulator exists at: /Users/mac/Downloads/android-sdk-macosx/tools/emulator info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set info AppiumDoctor ### Diagnostic completed, no fix needed. ### info AppiumDoctor  info AppiumDoctor Everything looks good, bye! info AppiumDoctor  注:若有檢查項未通過,可以去對應的android-sdk-macosx/tools/android中下載 4.安裝Appium-Python-Client:sudo pip install Appium-Python-Client ------------至此,appium的安裝已完畢------------

啟動appium server

在終端輸入appium &。輸出下面的資訊,則表示appium server啟動成功了

yoyodeMacBook-Pro:~ mac$ appium &

[1] 7599

yoyodeMacBook-Pro:~ mac$ [Appium] Welcome to Appium v1.9.1

[Appium] Appium REST http interface listener started on 0.0.0.0:4723

appium &

--以上就是mac下 python+appium的安裝過程,踩了很多坑,折騰了兩天,總算好用了?,最近沒什麼時間倒騰它,後續如果有學習會繼續分享的~