qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請?jiān)L問 http://qaseven.github.io/

          Appium for Mac環(huán)境準(zhǔn)備篇

           之前寫過一篇Appium for windows的文章,因?yàn)槭?9年的T400,啟動Android模擬器的時(shí)候死機(jī)三次,那就公司申請臺Macbook air吧,15寸的Macbook Pro實(shí)在太重了,也就Mac才能真正發(fā)揮Appium的功能,支持Android和iOS。好了,廢話不多,開始。
            1. 爬墻
            因?yàn)楹罄m(xù)安裝過程中可能會碰到墻的問題,所以首先得解決爬墻的問題。
            我的方便,公司提供代理。
            2. 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)
            3. git
            guowenxie-macbookair:~ guowenxie$ git --version
            git version 1.8.5.2 (Apple Git-48)
            4. ruby
            guowenxie-macbookair:~ guowenxie$ ruby -v
            ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]
            5. brew
            guowenxie-macbookair:~ guowenxie$ brew -v
            Homebrew 0.9.5
            這邊提下brew的安裝,brew是Mac OS不可或缺的套件管理器
            執(zhí)行下面命令
            ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
            6. node
            有了brew安裝node就方便了
            brew install node
            7. npm
            guowenxie-macbookair:~ guowenxie$ npm -v
            2.0.0-alpha-5
           8. Appium
            現(xiàn)在可以開始安裝Appium
            guowenxie-macbookair:~ guowenxie$ appium -v
            1.2.0
            9. wd
            npm install wd
            10. Xcode和Android SDK
            這個(gè)不說了
            11. 檢查環(huán)境
            Appium提供了一個(gè)doctor,運(yùn)行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沒有安裝,這個(gè)方便,F(xiàn)ix it 的時(shí)候輸入Y,就能自動導(dǎo)向安裝了。
            另一個(gè)是ANDROID_HOME的環(huán)境變量沒配置好,那么我們要配置下。
            12. bash_profile文件
            Mac 默認(rèn)是沒有這個(gè)文件的,我們自己建一個(gè)
            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)
            source .bash_profile
            好了,再次運(yùn)行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
            到此,環(huán)境基本準(zhǔn)備好了。
            最后,如果不想通過命令行安裝Appium,也可以安裝dmg

          posted on 2014-11-06 10:34 順其自然EVO 閱讀(5042) 評論(0)  編輯  收藏 所屬分類: 測試學(xué)習(xí)專欄android

          <2014年11月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 漳浦县| 昭平县| 清远市| 波密县| 丰县| 福安市| 密云县| 双鸭山市| 苏尼特右旗| 蒙山县| 潞西市| 藁城市| 甘南县| 兴文县| 湖北省| 彭泽县| 北安市| 呼伦贝尔市| 新余市| 响水县| 隆德县| 九龙县| 水城县| 杭锦旗| 威信县| 海伦市| 应城市| 东港市| 永善县| 手机| 湖南省| 延川县| 台东县| 周口市| 大理市| 夏河县| 明水县| 建昌县| 伊金霍洛旗| 类乌齐县| 疏附县|