Khi farm lớn từ 20+ máy, làm thủ công tốn rất nhiều thời gian. Python + ADB giúp tự động hoá gần như mọi tác vụ lặp đi lặp lại: cài app, gán proxy, reboot theo lịch, xoá data, chụp màn hình...
import subprocess, schedule, time def reboot_all(): result = subprocess.run(["adb", "devices"], capture_output=True, text=True) for line in result.stdout.strip().split(" ")[1:]: if " device" in line: dev = line.split(" ")[0] subprocess.run(["adb", "-s", dev, "reboot"]) print(f"🔄 Reboot: {dev}") # Reboot tất cả lúc 3h sáng mỗi ngày schedule.every().day.at("03:00").do(reboot_all) while True: schedule.run_pending(); time.sleep(60)
Zalo 094 678 2234 – Hỗ trợ kỹ thuật miễn phí 24/7