ubuntu18.04搭建appium环境
一、安装nodejs和npm
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm cache clean -f
sudo npm install n -g
sudo n stable
node -v
npm -v
二、使用npm全局安装appium和appium-doctor
sudo npm install -g appium 或 sudo npm install -g appium --unsafe-perm=true --allow-root
sudo npm install -g appium-doctor
sudo npm install -g cnpm -registry=http://registry.npm.taobao.org
sudo cnpm install -g appium
appium -v
sudo cnpm install -g appium-doctor
sudo chmod -R 777 /usr/local
sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
三、安装java环境
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk
java -version
sudo gedit /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile
四、安装Android SDK
tar xvzf android-sdk_r24.4.1-linux.tgz
./android
sudo gedit /etc/profile
export ANDROID_HOME=/home/hepburn/android-sdk-linux
export PATH=${ANDROID_HOME}/:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PATH
source /etc/profile
五、检查环境是否正确
appium-doctor