appinum1.15 + python3 + iOS 环境搭建

安装 libimobiledevice

brew install libimobiledevice --HEAD
在命令行输入ideviceinfo
出现报错我是依照下面命令重新安装(原因我也不知道)

brew uninstall ideviceinstaller

brew uninstall libimobiledevice

brew install --HEAD libimobiledevice

brew link --overwrite libimobiledevice

brew install ideviceinstaller

brew link --overwrite ideviceinstaller

安装usbmuxd

brew install --HEAD usbmuxd

安装xcode

我用的是macOS10.15 + xCode11.1

  1. 在app 搜索Xcode 点击安装。
    旧mac 系统不兼容最新版的xcode 可以到(https://developer.apple.com/download/more/)这里搜索较低的版版进行安装

  2. 安装 Command Line Tools
    在终端机里输入指令:
    xcode-select --install
    在终端机输入:
    xcode-select -p
    显示出: /Applications/Xcode.app/Contents/Developer
    即是成功安装!

ps 自己下载旧版xcode 如果不在 /Applications/Xcode.app/Contents/Developer,可以自行移到/Applications 目录下

安装carthage:

brew install carthage 或有需要更新 brew upgrade carthage

安装node:

brew install node

安装npm:

brew install npm

安装appium

1, npm install -g appium 命令行的appium
2, Desktop appium 安装 https://github.com/appium/appium-desktop/releases

ps :npm 安装appium 也可通过 appium --session-override -p %s -bp %s -U %s启动appium server,但桌面版appium 会更加方便。

安装ios-deploy:

npm install -g ios-deploybrew install ios-deploy

更新Appium中的WebDriverAgent

有一些教程会说从 GitHub 下载 Facebook 版 WebdriverAgent, 签名后复制到 Appium 的对应文件夹里。我试过发现 Facebook 版因为不再维护有些功能是没有的,现在直接用 Appium 项目里的 WebDriverAgent 就可以了。

使用xCode 打开 /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj
  1. 在TARGETS
  • WebDriverAgentLib -> Signing&Capabilities ->Team 选择开发者账号(需要已登记测试机设备)
  • WebDriverAgentRunner 同上
    我是把所有 Target 都签了一遍,不知道有没必要。
  1. 签完后选择 WebDriverAgentRunner 作为 Target, Device 选择用数据线连接着的 iOS 真机。
    从菜单栏选择 Product -> Test。
    Xcode 将编译项目,在真机上安装

Appium Desktop

配置:{
“xcodeOrgId”: “找开发要”,
“xcodeSigningId”: “iPhone Developer”,
“platformName”: “iOS”,
“platformVersion”: “12.4”, 根据测试机实际版本
“deviceName”: “iPhone 8 Plus”,根据测试机实际型号
“bundleId”: “找开发要”,
“automationName”: “XCUITest”,
“udid”: “” xCode -> Window -> Devices and … 可以看到连接上的iPhone udid
}

参考引用

brew install ios-deploy 安装失败
Mac安装Appium,自动化iOS APP
iOS 测试 WebDriverAgent 天坑记

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章