關(guān)于adb向多個(gè)真機(jī)發(fā)送命令(py語言)

有興趣可以先看看這個(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)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容