Appium搭建方法-IOS
安装 brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装Node
brew install node
安装jdk及包管理工具
brew cask install java
brew install carthage
brew install cmake
appium命令行版安装
npm install -g appium
iOS真机环境配置配置
安装 libimobiledevice,这是用于连接 iOS 设备的开源工具,类似于 Android 的ADB
brew install libimobiledevice --HEAD
安装 ios-deploy,这是支持使用命令行管理 iOS 设备 app 的工具
npm install -g ios-deploy
sudo npm install -g ios-deploy --unsafe-perm=true
安装 WebDriverAgent 到真机
将真机连接电脑
WebDriverAgentRunner 的处理:
先使用 mac 打开终端
cd ~
下载 WebDriverAgent 项目最新的代码:
git clone https://github.com/appium/WebDriverAgent
cd /Users/yourname/WebDriverAgent
mkdir -p Resources/WebDriverAgent.bundle
./Scripts/bootstrap.sh
cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver 或者 cd Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/
rm –rf WebDriverAgent 删除自带的 WebDriverAgentg) ln –s ~/WebDriverAgent WebDriverAgent 将最新的 WebDriverAgent 放入原来的路径下
双击 WebDriverAgent.xcodeproj 打开 WebDriverAgent 工程 或者使用命令(xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=00008020-000428911492002E' test)
设置签名证书(这里使用免费 App Id 的自签名证书)打开工程 TARGETS,选择WebDriverAgentLib&WebDriverAgentRunner->General,修改 Bundle Identify 为com.yfm.wda.lib(可自己取名),勾选为自动签名
安装 Appiun-desktop
下载地址:http://appium.io/
配置Appium { "platformName": "IOS", "platformVersion": "12.4", "deviceName": "IPhone", "xcodeOrgId": "U36G63WVB6", "udid": "00008020-000428911492002E", "xcodeSigningId": "iPhone Developer", "bundleId": "com.tuya.smart.Hoc", "automationName": "XCUITest" }
WebDriverAgent路径 :
/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
WebDriverAgent编译:
mkdir -p Resources/WdbDriverAgent.bundle
./Scripts/bootstrap.sh -d
运行:
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=00008020-000428911492002E'test
iproxy 安装 :brew install usbmuxd
iproxy 8100 8100
获取设备id :
idevice_id -l
libimobiledevice安装:
brew install --HEAD libimobiledevice
获取包名 :
ideviceinstaller -l
ideviceinstaller安装 :
brew install ideviceinstaller