adb连接手机模拟器
adb kill-server adb start-server adb remount adb connect 127.0.0.1:5555 #最后为端口号,网上查询 adb devices #查询是否连接成功查找app包名
#已安装 adb shell dumpsys activity recents | find "intent={" #查找最近打开的活动面 #返回cmp值:包名/activity页面 #有apk d:\program files\androidsdk\build-tools\29.0.3\aapt.exe dump badging d:\tools\apk\bili.apk | find "package: name=" #查找包名 :\tools\androidsdk\build-tools\29.0.3\aapt.exe dump badging d:\tools\apk\bili.apk | find "launchable-activity" #查找activity页面定位元素
driver.find_element_by_id('expand_search') #resource-id(不唯一) driver.find_elements_by_class_name('android.widget.TextView') #class(不唯一) driver.find_element_by_accessibility_id('找人') #content-desc(元素的描述,不唯一)xpath
driver.find_element_by_xpath('//android.widget.TextView') #其中节点名为class属性值
