一、环境准备:
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
classTestdemo:defsetup_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)
如果对你有帮助的话,点个赞收个藏,给作者一个鼓励。也方便你下次能够快速查找。
最后感谢每一个认真阅读我文章的人,礼尚往来总是要有的,虽然不是什么很值钱的东西,如果你用得到的话可以直接拿走:
这些资料,对于【软件测试】的朋友来说应该是最全面最完整的备战仓库,这个仓库也陪伴上万个测试工程师们走过最艰难的路程,希望也能帮助到你!











![[AI Perplexica] 安装指南:轻松部署AI驱动的开源搜索引擎](https://img-blog.csdnimg.cn/img_convert/373595a3348859997634304f1aa8e24d.png)








