Appium for Mac 环境准备篇

1 Appium for Mac 环境准备篇【原文地址:http://www.cnblogs.com/oscarxie/p/3894559.html

1.1 java

guowenxie-macbookair:~ guowenxie$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

1.2 git

guowenxie-macbookair:~ guowenxie$ git --version
git version 1.8.5.2 (Apple Git-48)

1.3 ruby

guowenxie-macbookair:~ guowenxie$ ruby -v
ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

1.4 brew

guowenxie-macbookair:~ guowenxie$ brew -v
Homebrew 0.9.5

这边提下brew的安装,brew是Mac OS不可或缺的套件管理器
执行下面命令
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

修改成:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

1.5 node

有了brew安装node就方便了
brew install node

备注:如果下载失败,就手动下载tar包;然后手动安装:

cd node #解压缩目录

./configure

make

sudo make install

1.6 npm

guowenxie-macbookair:~ guowenxie$ npm -v
2.0.0-alpha-5

1.7 Appium

现在可以开始安装Appium

guowenxie-macbookair:~ guowenxie$ appium -v
1.2.0

也可以直接在这里下载Appium:appium-0.18.0.dmg

1.8 wd

npm install wd

1.9 Xcode和Android SDK

这个不说了

1.10 检查环境

Appium提供了一个doctor,运行appium-doctor

guowenxie-macbookair:~ guowenxie$ appium-doctor
Running iOS Checks
? Xcode is installed at /Applications/Xcode.app/Contents/Developer
? Xcode Command Line Tools are NOT installed: Error: Command failed: No receipt for ‘com.apple.pkg.CLTools_Executables‘ found at ‘/‘.
Fix it? (y/n) y
Press any key to continue:
? Xcode Command Line Tools are installed.
? DevToolsSecurity is enabled.
? The Authorization DB is set up properly.
? Node binary found at /usr/local/bin/node
? iOS Checks were successful.
Running Android Checks
? ANDROID_HOME is set but does not exist on the file system at "Users/guowenxie/Documents/adt-bundle_mac-x86_64-20140702/sdk"
Appium-Doctor detected problems. Please fix and rerun Appium-Doctor.

这里可以看到我Xcode Command Line Tools没有安装,这个方便,Fix it?的时候输入Y,就能自动导向安装了。
另一个是ANDROID_HOME的环境变量没配置好,那么我们要配置下。

1.11 bash_profile文件

Mac 默认是没有这个文件的,我们自己建一个

cd #进入用户目录
touch .bash_profile

vi .bash_profile
打开bash_profile文件配置ANDROID_HOME和JAVA_HOME
export ANDROID_HOME="/Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk"
export JAVA_HOME=$(/usr/libexec/java_home)

变更成

export ANDROID_HOME=/Users/xujin/Downloads/android-sdk-macosx #配置Android SDK根目录

export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools #配置两个路径

export JAVA_HOME=$(/usr/libexec/java_home)

source .bash_profile
好了,再次运行appium-doctor

guowenxie-macbookair:~ guowenxie$ appium-doctor
Running iOS Checks
? Xcode is installed at /Applications/Xcode.app/Contents/Developer
? Xcode Command Line Tools are installed.
? DevToolsSecurity is enabled.
? The Authorization DB is set up properly.
? Node binary found at /usr/local/bin/node
? iOS Checks were successful.
Running Android Checks
? ANDROID_HOME is set to "/Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk"
? JAVA_HOME is set to "/usr/libexec/java_home."
? ADB exists at /Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb
? Android exists at /Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/android
? Emulator exists at /Users/guowenxie/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/emulator
? Android Checks were successful.
? All Checks were successful

到此,环境基本准备好了。

2 获取**.app格式文件方法

  • 选择Profile without Building 后,会调用Instruments

  • 选择Automation

  • 打开终端输入:cd app文件路径 后 输入命令 open .打开当前路径文件夹,把app格式文件复制黏贴到桌面即可

    

3 Appium 设置

  • 点击Appium-Preferences 如下图设置即可

  

  • 设置Xcode路径

  

  • 设置app格式文件路径

  

到此,Appium设置完毕。

4 Eclipse准备条件

点击菜单help → Eclipse Marktplace安装以下插件:

1. Android for Maven Eclipse version

2. Maven (Java EE) Integration for Eclipse WTP (Luna) version

3. Maven Integration for Eclipse (Luna and newer) version

4. Maven Integration for Eclipse (Luna) version

5. Maven Integration for Eclipse WTP (Juno) version

6. Subversive – SVN Team Provider version

7. TestNG for Eclipse

都可以在Search-Find那里检索出。

8.安装Apache maven【apache-maven-3.2.3-bin.tar

9.安装org.testng.eclipse_6.8.6.20141201_2240.jar

5 构建/获取自动化测试代码

更多内容待完善补充

6 jenkins设置

更多内容待完善补充

时间: 2024-10-04 07:51:42

Appium for Mac 环境准备篇的相关文章

Appium - iOS Mac环境结构

笔者: Max.Bai 时间: 2014/10 1. iOS开发环境的搭建 1.1系统要求 MacOS X 10.7 or higher, 10.9.2 recommended 1.2 xcode要求 xcode6.0(Appium 1.3). xcode5.0(Appium1.2) 1.3 Apple Developer Tools (iPhone simulator SDK, command line tools) 安装ios SDK,command line tools 2. Node j

Appium - iOS Mac环境搭建

作者: Max.Bai 时间: 2014/10 1. iOS开发环境搭建 1.1系统要求 MacOS X 10.7 or higher, 10.9.2 recommended 1.2 xcode要求 xcode6.0(Appium 1.3), xcode5.0(Appium1.2) 1.3 Apple Developer Tools (iPhone simulator SDK, command line tools) 安装ios SDK,command line tools 2. Node js

Appium Java Windows环境搭建篇

1. 安卓SDK及配置环境变量 1.1.先下载sdk安装包:installer_r24.4.1-windows.exe 下载地址:链接: http://pan.baidu.com/s/1dEyPSa9 密码: n8dj下载后打开安装,一路下一步即可,安装完后,查看sdk安装目录:少了platform-tools这个文件夹,即对应文件夹下,文件也全无 1.2.那么需要先把这个文件夹及文件夹下内容补全 下载地址:链接: http://pan.baidu.com/s/1qXoufO4 密码: z7cx

移动端自动化测试(一)之 Appium+Pyhton环境准备篇

由于工作的需要进行Andriod手机app自动化测试,公司现有支持的app的手机平台(Andriod和IOS), 所以选择了Appium工具.因为Andriod和IOS,Appium都支持.百度和谷歌上的各种Appium教程可谓是琳琅满目,但大抵都是浅尝辄止.因此笔者想要总结一套较全面的Appium的实战经验,以此记录我遇到的坑和填过的坑. web自动化测试的路线是这样的:编程语言基础--->测试框架--->webdriver API(selenium2)--->开发自动化测试项目. 移

Appium Android测试环境搭建 for Mac

Appium Android测试环境搭建 涉及的资源,工具都很多 ,从网上各种资料查找,整合一下资源,针对小白级别. 1.Appium安装: 转载自:http://www.cnblogs.com/oscarxie/p/3894559.html. 2.Mac配置Android环境变量: 转载自:http://www.jianshu.com/p/84f3baf1682c 3.Mac安装Android模拟器genymotion: 转载自:http://blog.csdn.net/l_215851356

(mac环境)Appium安装了client包,但是提示no module named appium

背景 mac环境,使用pip install Appium-Python-Client已经安装了client包 问题 import appium,提示no module named appium 解决方案 cd /usr/local/bin pip3 install Appium-Python-Client 如果安装时遇到了以下问题 You are using pip version 8.1.1, however version 8.1.2 is available. You should co

appium一: mac环境准备

简单方式:直接在appium官网下载dmg文件进行安装: http://appium.io/  点击download下载.dmg 再双击此. dmg文件进行自动安装: 安装完成后,将其拖动至 应用程序 列表中 即可. 双击应用图标进行打开,打开后,如下图所示(mac需要先设置下"安全选项",允许打开第三方渠道的应用) 再进行check,确认所需的工具全部安装完成(若没有完成的,按照提示 进行安装即可): 下图显示Running ios 全部完成 : 安装完成! 启动成功! 命令行方式进

appium在MAC上环境搭建

1. 安装.启动Appium [email protected] ~$ npm install -g appium Password: npm http GET https://registry.npmjs.org/appium npm http 200 https://registry.npmjs.org/appium npm http GET https://registry.npmjs.org/appium/-/appium-0.15.0.tgz npm http 200 https://

Mac&Appium&Python自动化测试-环境搭建之安卓SDK

一.摘要 本博文将详细讲述在Mac环境下的jdk安装.配置以及环境校验:安卓sdk安装.配置以及环境校验 二.安装包工具准备: jdk1.8.0(64 位) android-sdk_r24.4.1-mac osx.zip 三.JDK的安装及配置 官方下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 选中"Accept License Agreement",下