Python——appium

1、环境配置
参考文章:
https://blog.csdn.net/qq_16206535/article/details/79586818
https://www.cnblogs.com/glumer/p/8485052.html

坑:
在cmd下运行不了adb的情况下的解决方案:
win+R运行cmd,cd 到platform-tools文件下,可以看见adb,再使用adb命令。
这里不要使用win10里面的powershell
在这里插入图片描述

坑:
npm install -g appium时,出现了警告,等其他问题
一般是环境变量添加的问题,要仔细着。
警告:warning: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {“os”
原因: fsevent是mac osx系统的,在win或者Linux下使用了 所以会有警告,忽略就好了,意思就是你已经安装成功了,之后npm run dev即可。
不支持:
notsup
SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted
{“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

2、连接真机
问题集锦:https://blog.csdn.net/niubitianping/article/details/52624417
http://blog.sina.com.cn/s/blog_53f023270102v8wi.html
华为手机打开 允许调试:https://jingyan.baidu.com/article/2a138328ec2c43074a134fb4.html

在这里插入图片描述

坑:
https://www.cnblogs.com/niepeishen/p/5762162.html

使用appium打开手机程序

获取手机正在运行的 app的包:

C:\Users\Administrator>adb shell dumpsys window | findstr "mCurrent"
    mCurrentAppOrientation=1
      mCurrentRotation=0
  mCurrentFocus=Window{1e7224c u0 com.xes.jazhanghui.activity/com.xes.jazhanghui.activity.mvp.navigator.view.activity.NavigatorActivity}

获取手机设备名称(model)

C:\Users\Administrator>adb devices -l
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
S3V0217913002254       device product:NTS-AL00 model:NTS_AL00 device:HWNTS

在这里插入图片描述
在这里插入图片描述

发布了55 篇原创文章 · 获赞 17 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_43213658/article/details/94719373