需要安装的工具(✔️先安装好)

  • git
  • npm
  • node.js
  • ios-deploy (调试iPhone应用的是第三方开源库)
  • [ ] libimobiledevice开源包
  • [x] appium-Desktop
  • Xcode
  • homebrew
  • carthage(第三方依赖管理工具)
  • WebDriverAgent

    NPM&Node.js安装

    安装npm同时安装node.js
    1. brew install npm

    ios-deploy安装

    1. npm install -g ios-deploy

    libimobiledevice开源包安装

    其他使用命令:https://www.jianshu.com/p/592fcffdc71a

  1. 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
屏幕快照 2020-04-28 下午6.50.53.png

mac安装homebrew失败怎么办?

官网:https://brew.sh/index_zh-cn (如果有小飞机,蓝灯可以尝试)
因为官网受网络环境等因素限制,国内安装肯定翻车,翻到不要不要的,根本无法连接,帮大家找了一个国内的安装包,详细去下面看看,懒得直接复制代码!

https://www.zhihu.com/question/35928898

安装方法:
打开终端,将这段代码粘贴并运行

  1. /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

运行后根据提示选择,即可,这里我选1
安装期间如果提示失败,退出重新安装
屏幕快照 2020-04-28 下午6.45.25.png
安装成功后是这个结果的
屏幕快照 2020-04-28 下午6.46.17.png

carthage安装

  1. brew install carthage

检查是否完整安装

通过运行下面的检查命令,查询结果

  1. appium-doctor --ios

截屏2020-04-29 上午12.25.30.png

如果有类似这些提示,全部处理好:WARN AppiumDoctor ➜ Please install Carthage. Visit https://github.com/Carthage/Carthage#installing-carthage for more information.

再次运行appium-doctor —ios
截屏2020-04-29 上午1.31.03.png

WebDriverAgent安装

官网:https://github.com/facebookarchive/WebDriverAgent
找个一个自己能找到的位置先克隆下来

  1. git clone https://github.com/facebookarchive/WebDriverAgent.git

进入到WebDriverAgent的目录里面,运行命令进行安装

  1. ./Scripts/bootstrap.sh

安装完成后会有这样的显示
截屏2020-04-29 上午2.09.01.png
进入到WebDriverAgent目录找到WebDriverAgent.xcodeproj双击用Xcode打开
需要设置的AID
Xcode-Preferences-Accounts,下点击加号添加自己的AID
截屏2020-04-29 上午4.49.58.png
设置证书:WebDriverAgentLib、WebDriverAgentRunner和IntegrationApp
Team:设置自己的AID
Bundle Identifier:换一个名字原本com.facebook.WebDriverAgentLib,最简单就把Facebook改为其他就行,后面的几个文件都一同修改
image.png

连接真机疯狂报错,踩坑,翻车

⚠️Could not build module ‘RoutingHTTPServer’

⚠️’assign’ property of object type may become a dangling reference; consider using ‘unsafe_unretained’

截屏2020-04-29 上午4.00.05.png
搜索了一番assign改为strong

方法是在这里找的:https://blog.csdn.net/weixin_43291944/article/details/103562488

image.png
红色的处理完还有黄色的感叹号!!!

⚠️/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

image.png