程序与真机连接方式:
顺序如下(否则会报错):
from appium import webdriver from appium import webdriver import os from time import sleep cape={ "deviceName": "127.0.0.1:5555", "appPackage": "com.ss.android.article.news", # 命令:adb shell "dumpsys window | grep mCurrentFocus" "appActivity": "com.ss.android.article.news.activity.MainActivity", # 命令:adb shell "dumpsys window | grep mCurrentFocus" "platformName": "Android", "noReset": "true" }
App的activity(启动页):adb shell "dumpsys window | grep mCurrentFocus"
包名:adb shell pm list packages
Android序列号:adb devices