需要安装的工具(✔️先安装好)
- git
- npm
- node.js
- ios-deploy (调试iPhone应用的是第三方开源库)
- [ ] libimobiledevice开源包
- [x] appium-Desktop
- Xcode
- homebrew
- carthage(第三方依赖管理工具)
- WebDriverAgent
NPM&Node.js安装
安装npm同时安装node.jsbrew install npm
ios-deploy安装
npm install -g ios-deploy
libimobiledevice开源包安装
brew install --HEAD libimobiledevice
Appium Desktop
官网下载地址:https://github.com/appium/appium-desktop/releases/tag/v1.15.1
Xcode安装
这个在官网下载就可以了,https://developer.apple.com/xcode/resources/
如果你的mac是10.13的版本需要点击下方的 Older Versions of Xcode
mac安装homebrew失败怎么办?
官网:https://brew.sh/index_zh-cn (如果有小飞机,蓝灯可以尝试)
因为官网受网络环境等因素限制,国内安装肯定翻车,翻到不要不要的,根本无法连接,帮大家找了一个国内的安装包,详细去下面看看,懒得直接复制代码!
安装方法:
打开终端,将这段代码粘贴并运行
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
运行后根据提示选择,即可,这里我选1
安装期间如果提示失败,退出重新安装
安装成功后是这个结果的
carthage安装
brew install carthage
检查是否完整安装
通过运行下面的检查命令,查询结果
appium-doctor --ios
如果有类似这些提示,全部处理好:WARN AppiumDoctor ➜ Please install Carthage. Visit https://github.com/Carthage/Carthage#installing-carthage for more information.
WebDriverAgent安装
官网:https://github.com/facebookarchive/WebDriverAgent
找个一个自己能找到的位置先克隆下来
git clone https://github.com/facebookarchive/WebDriverAgent.git
进入到WebDriverAgent的目录里面,运行命令进行安装
./Scripts/bootstrap.sh
安装完成后会有这样的显示
进入到WebDriverAgent目录找到WebDriverAgent.xcodeproj双击用Xcode打开
需要设置的AID
Xcode-Preferences-Accounts,下点击加号添加自己的AID
设置证书:WebDriverAgentLib、WebDriverAgentRunner和IntegrationApp
Team:设置自己的AID
Bundle Identifier:换一个名字原本com.facebook.WebDriverAgentLib,最简单就把Facebook改为其他就行,后面的几个文件都一同修改
连接真机疯狂报错,踩坑,翻车
⚠️Could not build module ‘RoutingHTTPServer’
⚠️’assign’ property of object type may become a dangling reference; consider using ‘unsafe_unretained’
搜索了一番assign改为strong
方法是在这里找的:https://blog.csdn.net/weixin_43291944/article/details/103562488
红色的处理完还有黄色的感叹号!!!
⚠️/Users/tommyhui/Desktop/WebDriverAgent/WebDriverAgent.xcodeproj User-supplied CFBundleIdentifier value ‘com.facebook.wda.runner‘ in the Info.plist must be the same as the PRODUCT_BUNDLE_IDENTIFIER build setting value ‘com.tmf.WebDriverAgentRunner’.
需要找到WebDriverAgentRunner文件下面的Info.plist修改之前设置的签名,我这是com.tmf.WebDriverAgentRunner
这个答案是在这里找的:https://www.jianshu.com/p/d4609fbb6a87