appium环境搭建(windows&macos)

参考文档地址:https://blog.csdn.net/weixin_43916473/article/details/108534460

windows下环境搭建

JDK环境搭建

建议jdk>=1.8
1.下载JDKhttps://www.oracle.com/java/technologies/javase-downloads.html
2.配置环境变量
新建系统变量,变量名JAVA_HOME,变量值为JDK的安装路径。在这里插入图片描述
编辑系统变量Path,新增两个变量
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin
最后确认结果,java -version

安装appium-desktop

下载地址:https://github.com/appium/appium-desktop/releases/
不需要安装NodeJS
appium-desktop集成了appium inspector,appium server

安装夜神模拟器

打开电脑vt状态
夜神配置本地环境变量:
在这里插入图片描述
将本地环境adb.exe替换至夜神bin目录下,重命名为nox_adb.exe
夜神连接adb:nox_adb.exe connect 127.0.0.1:62001
adb devices查看设备连接状态

adb kill-server 重启server
appium -g 日志地址日志名字(生成日志)

Windows查看当前app的activity:adb shell dumpsys window|findstr mCurrent

macos下环境搭建

appium-desktop安装包:https://blog.csdn.net/weixin_41696733/article/details/105781911
安装环境参考:https://blog.csdn.net/weixin_36192992/article/details/124260978

遇到的坑:
1.Appium连接手机时报权限错误 Security exception: Permission Denial: starting Intent
解决方式:desired capacities 中的app activity不是start activity
2.启动uiautomatorviewer报错:Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncExcept…
解决方法:

  • 在cmd命令窗口中输入 adb root 即可;
  • 重启手机无效;
  • 重新把手机拔了再插;
  • 重启appuim;
  • 重启uiautomatorviewer.bat;
  • 打开手机开发者权限,将USB调试按钮重新启动就好了;
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值