Created
May 1, 2020 02:42
-
-
Save nghiahsgs/4e69f53d0f9fccee2edbfed4a3e0132e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import subprocess | |
id_device='emulator-5554' | |
def adb_click(coord_x,coord_y): | |
adb_command='adb -s %s shell input tap %s %s'%(id_device,coord_x,coord_y) | |
subprocess.call(adb_command) | |
def adb_send_text(text): | |
adb_command='adb -s %s shell input text %s'%(id_device,text) | |
subprocess.call(adb_command) | |
# def screen_capture() | |
# adb_command='adb -s {device_id} shell screencap -p /sdcard/screencap{index}.png && adb pull /sdcard/screencap{index}.png D:\LDPlayer' | |
# adb_click(228,138) | |
# adb_send_text('nghia%snghiahsgs') | |
# time.sleep() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment