Skip to content

Instantly share code, notes, and snippets.

@sorcererxw
Last active June 10, 2019 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sorcererxw/559639d34b99fd04c85b5f84270a00fd to your computer and use it in GitHub Desktop.
Save sorcererxw/559639d34b99fd04c85b5f84270a00fd to your computer and use it in GitHub Desktop.
即刻奶茶大战 adb 自动脚本
import subprocess
import sys
import time
def adbShell(command):
subprocess.Popen(["adb", "shell", command],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
cnt = 0
peer = 20
while True:
cnt += 1
command = ""
for j in range(0, peer):
command += "input tap 512 1900;"
adbShell(command)
print('tap')
time.sleep(3)
@sorcererxw
Copy link
Author

sorcererxw commented Jun 6, 2019

使用方法

  1. 一台 Android 设备 (本脚本基于分辨率为 1080p 的设备,其他设备请自行调整)
  2. 安装 adb
    1. MacOS: brew install adb
    2. Windows: scoop install adb
  3. 安装 python
    1. MacOS: brew install python
    2. Windows: scoop install python
  4. 创建文件 jike-mike-tea-war.py,并将上面代码复制进去保存
  5. 将手机连上电脑,开启 USB 调试,开好奶茶大战页面,电脑上执行 python jike-mike-tea-war.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment