1、使用安卓手机
2、打开USB调试
3、用电脑开热点,手机连接(wireshark抓包使用,本机过滤器选本地连接2)
4、cmd运行adb devices,查看是否可连接此设备
5、
ADB_PATH = 'D:\\nox\\Nox\\bin\\adb.exe'
# 获取所有设备
def get_all_devices():
get_services_args = [ADB_PATH, 'devices']
result = subprocess.getstatusoutput(get_services_args)
device = []
if result[0] == 0:
all_devices = result[1].split('\n')
if len(all_devices) > 1:
for d in all_devices:
d = d.split('\t')
if len(d) == 2 and d[1] == 'device':
device.append(d[0])
print('get %s device' % len(device))
return device