为了在真机上使用Appium,踩了两天的坑.
总结一下过程
- 下载WebdriverAgent:
git clone https://github.com/facebook/WebDriverAgent
- 进入目录,执行:
mkdir -p Resources/WebDriverAgent.bundle
sh ./Scripts/bootstrap.sh
- xcode打开WebDriverAgent.xcodeproj , 使用
Automatically manage signing
![](https://img.haomeiwen.com/i122666/74487165fb1516fd.png)
![](https://img.haomeiwen.com/i122666/3a7a04e4888b1172.png)
- 手机连上电脑,xcode编译成功,
Alt + u
运行测试成功
![](https://img.haomeiwen.com/i122666/dfdd82e5b9fabc1d.png)
- 端口映射
iproxy 8100 8100
- 访问
http://localhost:8100/inspector
, 访问成功.
- 第3步有个天坑,我使用公司的Team开发账号,xcode在模拟器运行成功,一到真机运行就崩溃. 改成我自己的个人开发者账号,完美成功.不知道为什么..
- 第6步有个莫名其妙的坑:每次运行都不在8100端口,而是0端口,也无法访问. 搜索了无数答案都无法解决.最后删掉了重新下载,重来一遍,解决了.....
网友评论