一、环境准备:
1、安装appium
2、xcode
(appium 版本:12.1.0 + xcode版本:12.5 可正常运行,ps:appium 版本:12.1.0 + xcode版本:13.0 一直报奇奇怪怪的错误)
3、依赖工具包安装
brew install --HEAD ideviceinstaller
brew install --HEAD libimobiledevice
brew install ios-deploy
4、测试app,使用官方推荐的demo来进行测试
地址:https://github.com/appium/ios-uicatalog

克隆到本地:
git clone https://github.com/appium/ios-uicatalog.git
二、
1、打开xcode、打开项目

2、编译运行:



成功运行 ios模拟器

3、使用appium 运行模拟器 打开测试app

start session

三、执行脚本启动:
import time
import pytest
from appium import webdriver
class Testdemo:
def setup_class(self):
desired_caps = {
"platformVersion": "14.5",
"platformName": "iOS",
"deviceName": "iPhone 12",
"app": "/xxxx/xxxx/DerivedData/UIKitCatalog-eppvxufmuhyeyhfxhygkhqccbfjh/Build/Products/Debug-iphonesimulator/UIKitCatalog.app"
}
self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
网友评论