有興趣可以先看看這個(gè)網(wǎng)站中列出的命令http://adbshell.com
首先使用adb devices列出所有的真機(jī)(即你的手機(jī))
以下的我的手機(jī)
219fac0e? ? ? ? ?device
5758cc8d? ? ? ? device
點(diǎn)擊坐標(biāo)
adb -s 219fac0e? shell input tap 123 123
adb -s 5758cc8d? shell input tap 123 123
下面是一段python代碼實(shí)現(xiàn)
import os
attached_list = os.popen('adb devices').readlines()
del attached_list[0]
aaaaa = attached_list[0]
#
attached_codes = []
a =0
for iin range(len(attached_list)):
tmp = attached_list[i].split(" ")
if len(tmp[0]) >5:
attached_codes.append(attached_list[i][0:8])
pass
print(attached_codes)
for onein attached_codes:
os.system("adb -s %s shell input tap 123 123"% one)