码迷,mamicode.com
首页 > 移动开发 > 详细

Appium环境配置-Mac

时间:2016-07-21 21:53:14      阅读:332      评论:0      收藏:0      [点我收藏+]

标签:

1、下载appium之前命令行检查

$ java -version
java version "1.8.0_71"
Java(TM) SE Runtime Environment (build 1.8.0_71-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
$ brew -v Homebrew 0.9.9 (git revision 1158; last commit 2016-07-20) Homebrew/homebrew-core (git revision 666b; last commit 2016-07-20) $ node -v v6.3.0

如果brew和node未安装: 

a.安装brew命令

$ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
b.安装node命令
$brew install node

 

2、安装Appium

a.给予local文件可读可写可执行权限

$sudo chmod -R 777 /usr/local

b.非root权限下安装Appium

$npm install -g appium

c.安装Appium Client

$git clone https://github.com/appium/python-client.git
$cd python-client/
$sudo python setup.py install

d.安装appium-doctor(已经安装的用户可忽略)

$ appium-doctor
-bash: appium-doctor: command not found
superFangfang:python-client macbook$ npm install appium-doctor -g 

e.安装appium.dmg客户端

下载链接地址:https://bitbucket.org/appium/appium.app/downloads/

 

3.检查Appium成功安装

$ appium-doctor
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ? Xcode is installed at: /Applications/Xcode.app/Contents/Developer
WARN AppiumDoctor  ? Xcode Command Line Tools are NOT installed!
info AppiumDoctor  ? DevToolsSecurity is enabled.
info AppiumDoctor  ? The Authorization DB is set up properly.
info AppiumDoctor  ? The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor  ? HOME is set to: /Users/macbook
WARN AppiumDoctor  ? ANDROID_HOME is NOT set!
WARN AppiumDoctor  ? JAVA_HOME is set to ‘/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home‘ but this is NOT a valid path!
WARN AppiumDoctor  ? adb could not be found because ANDROID_HOME is NOT set!
WARN AppiumDoctor  ? android could not be found because ANDROID_HOME is NOT set!
WARN AppiumDoctor  ? emulator could not be found because ANDROID_HOME is NOT set!
info AppiumDoctor ### Diagnostic completed, 6 fixes needed. ###
info AppiumDoctor 
info AppiumDoctor ### Manual Fixes Needed ###
info AppiumDoctor The configuration cannot be automatically fixed, please do the following first:
WARN AppiumDoctor - Manually configure ANDROID_HOME.
WARN AppiumDoctor - Manually configure JAVA_HOME.
WARN AppiumDoctor - Manually configure ANDROID_HOME and run appium-doctor again.
info AppiumDoctor ###
info AppiumDoctor 
info AppiumDoctor Bye, run appium-doctor again when all manual fixes have been applied!
info AppiumDoctor 

以上有部分软件未安装,接下来弥补上。

a.Xcode Command Line Tools

$ xcode-select --install
xcode-select: note: install requested for command line developer tools

b.Android SDK

下载地址:https://developer.android.com/studio/install.html

下载完成之后,安装网上步骤一步一步安装并下载完SDK成之后,配置环境变量

# vim /etc/profile

export ANDROID_HOME=/Users/macbook/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

c.网上下载java安装后,配置环境变量

# vim /etc/profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

 

再次检查Appium成功安装
$ appium-doctor
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ? Xcode is installed at: /Applications/Xcode.app/Contents/Developer
info AppiumDoctor  ? Xcode Command Line Tools are installed.
info AppiumDoctor  ? DevToolsSecurity is enabled.
info AppiumDoctor  ? The Authorization DB is set up properly.
info AppiumDoctor  ? The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor  ? HOME is set to: /Users/macbook
info AppiumDoctor  ? ANDROID_HOME is set to: /Users/macbook/Library/Android/sdk
info AppiumDoctor  ? JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_71.jdk/Contents/Home
info AppiumDoctor  ? adb exists at: /Users/macbook/Library/Android/sdk/platform-tools/adb
info AppiumDoctor  ? android exists at: /Users/macbook/Library/Android/sdk/tools/android
info AppiumDoctor  ? emulator exists at: /Users/macbook/Library/Android/sdk/tools/emulator
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor 
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor 

  

 

Appium环境配置-Mac

标签:

原文地址:http://www.cnblogs.com/wonderful0714/p/5692549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!