adb连接华为真机
- 打开华为手机开发者模式:设置—>关于手机—>版本号(连点7次,进入开发者模式)—>系统和更新—>开发人员选项—>USB调试开启—>"仅充电"模式下允许ADB调试
- 连接数据线至pc,打开cmd,输入
adb devices
,出现设备名称,连接成功
安装weditor:
cmd:
1.pip install Uiautomator2
2.python -m uiautomator2 init(报错:进程被终止,查看是atx-agent未安装成功,自行下载安装包本地安装,成功)
3.pip install weditor(报错,git clone 克隆到本地再安装,成功)
确认安装成功:weditor --help
使用weditor:
cmd:>>weditor
设置appium
虽然华为系统升级为了鸿蒙,但依旧可以用Android的配置和命令
查看版本: adb shell getprop ro.build.version.release
查看当前窗口的包名: 先打开手机中你要获取包名的APP
adb shell dumpsys window | findstr mCurrentFocus
# 导包appium
from appium import webdriver
import time
# 连接移动设备所必需的参数,放到字典中
desired_caps = {
'deviceName': 'MYQUT1*****', 'platformName': 'Android', 'platformVersion': '10',
'appPackage': 'com.ss.android.ugc.aweme', 'appActivity': '.splash.SplashActivity', 'noReset': True}