参考有图详细地址: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