Appium+iOS真機環境搭建

參考有圖詳細地址:https://www.jianshu.com/p/703476fb9467node

本次環境配置相關:
macOS:10.13.4
Appium-desktop 用最新的
Xcode 用最新的ios

環境git

一、 安裝homebrew:$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"github

二、 安裝libimobiledevice:$ brew install libimobiledevice --HEADnpm

三、 安裝carthage:$ brew install carthagebootstrap

四、安裝node:$ brew install nodexcode

五、安裝npm:$ brew install npmruby

六、安裝ios-deploy:$ npm install -g ios-deployapp

八、安裝xcpretty:$ gem install xcprettycurl

九、安裝appium,appium-doctor進入官網,下載,安裝便可。

十、使用appium-doctor 檢查Appium iOS環境環境appium-doctor --ios

 

安裝WebDriverAgent

一、進入appium安裝目錄下WebDriverAgent文件夾,具體路徑參照本身的路徑,能夠經過find命令查找

cd /Applications/Appium.app/Contents/Resources/app
/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

二、在WebDriverAgent目錄下執行如下命令

mkdir -p Resources/WebDriverAgent.bundle

sh ./Scripts/bootstrap.sh

三、編譯WebDriverAgent.xcodeproj

Xcode打開當前目錄下的WebDriverAgent.xcodeproj文件

       一、TARGETS->WebDriverAgentLib的Bundle Identifier更改成本身命名的Identifier。(全部Identifier注意保持一致!!)

       二、TARGETS->WebDriverAgentLib的Signing選擇使用我的的證書。

       三、TARGETS->WebDriverAgentRunner的Signing選擇使用我的的證書。

       四、PROJECT->WebDriverAgent的Product Bundle Identifier更改成本身命名的Identifier。(全部Identifier注意保持一致!!)

      五、TARGETS->WebDriverAgentLib的Product Bundle Identifier更改成本身命名的Identifier。(全部Identifier注意保持一致!!)

      六、TARGETS->WebDriverAgentRunner的Product Bundle Identifier更改成本身命名的Identifier。(全部Identifier注意保持一致!!)

      七、Device選擇已鏈接的測試機

      八、點擊build按鈕來測試,按照步驟設置後,可build succeeded~   

      九、測試機上安裝證書,執行如下命令:

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=測試機的udid' test

若是沒有報錯證實安裝成功,同時手機上會安裝一個WebDriverAgent軟件。須要在手機設置->通用->設備管理->信任開發者

若是沒有報錯證

 

Appium Client有Ruby,Python,Java三個版本,可自行選擇本身喜歡的安裝便可 pip install Appium-Python-Client

相關文章
相關標籤/搜索