使用Python实现apk自动安装

Python install APK

Posted by XYH on October 10, 2018

本文记录如何使用Python自动批量安装apk。

利用Python执行ADB命令 adb install xxx

1
2
3
4
5
6
7
8
9
import os

folder = 'C:/users/17267/Desktop/debug/'
files = os.listdir(folder)
for file in files:
    if file[len(file) - 3:len(file)] == "apk":
        instructions = 'adb install ' + folder + file
        print("执行命令", instructions)
        os.system(instructions)