Skip to content

Instantly share code, notes, and snippets.

@odmnk
Created June 27, 2021 19:48
Show Gist options
  • Save odmnk/c8fe76230265ac20bf2ef8afe775d9b1 to your computer and use it in GitHub Desktop.
Save odmnk/c8fe76230265ac20bf2ef8afe775d9b1 to your computer and use it in GitHub Desktop.
Reproduces the problem of freezes when sending commands to device using ADB over WiFi
import subprocess
import time
DEVICE_ID = "192.168.2.3:5555"
for x in range(100):
print(x)
print("sleep")
subprocess.call(f"adb -s {DEVICE_ID} shell input keyevent KEYCODE_SLEEP", shell=True)
time.sleep(3)
print("wakeup")
subprocess.call(f"adb -s {DEVICE_ID} shell input keyevent KEYCODE_WAKEUP", shell=True)
time.sleep(3)
print("===================")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment