appium环境搭建可参考以下两个链接: https://www.jianshu.com/p/a2b79cd8bf38 https://www.jianshu.com/p/3c04e029c3ea
环境配置: carthage: stable 0.31.2 (bottled), HEAD usbmuxd: stable 1.0.10 (bottled), HEAD libimobiledevice: stable 1.2.0 (bottled), HEAD npm 6.4.1 ios-deploy 1.9.4 xcpretty 0.3.0 appium-doctor 1.6.0 Appium v1.9.1 Python 3.7 WebDriverAgent 用GitHub的[https://github.com/facebook/WebDriverAgent ] Xcode10.1
每次真机开发启动顺序: 1.先在终端启动WDA(或者直接用XCode直接【WebDriverAgentRunner】-【testing】也行)
xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=设备ID test
进行端口转发
iproxy 8100 8100 设备ID
Appium Server.png
配置信息:
"deviceName": "iPhone 6s",
"platformName": "ios",
"udid": "601861ce25a7dae4dc3d12e6f43cd42936XXXXXX",
"automationName": "XCUITest",
"xcodeOrgId": " 7GTPKLXXXX",
"xcodeSigningId": "iPhone Developer",
"no-reset": true,
"startIWDP": true,
"bundleId": "com.XXXXXX"
export DEVICE_URL='http://localhost:8100'
export JSON_HEADER='-H "Content-Type: application/json;charset=UTF-8, accept: application/json"'
curl -X GET $JSON_HEADER $DEVICE_URL/status
或
http://localhost:8100/status
如果单纯WebDriverAgent运行成功,然后appuim没有反应,可能因为有些国产的iPhone设备通过手机的IP和端口还不能访问,此时需要将手机的端口转发到Mac上 : 终端输入:iproxy 8100 8100 <DeviceUDID>
sudo xcode-select --switch /Applications/Xcode9.4.1.app
sudo xcode-select --switch /Applications/Xcode.app
/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
2、使用appium desktop的wda模块
/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
brew install --HEAD libimobiledevice
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有