Last active
June 1, 2022 18:55
-
-
Save hassancodes/158c799c6060861dd34931fc2baffa3d to your computer and use it in GitHub Desktop.
Automating Tiktok using PurePython-ADB
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
from ppadb.client import Client as AdbClient | |
import time | |
# Default is "127.0.0.1" and 5037 | |
# initializing AdbClient() | |
client = AdbClient(host="127.0.0.1", port=5037) | |
devices = client.devices() | |
if len(devices) == 0: | |
print("No devices attached") | |
quit() | |
device = devices[0] | |
def swipe(): | |
print("Enter the Number of swipes: ") | |
swipe_times = int(input()) | |
for i in range(swipe_times): | |
device.shell("input swipe 550 1500 550 600 100") | |
time.sleep(10) | |
# x = 992 | |
# y =1430 | |
# x,y is cordinates of the like button | |
device.shell('input touchscreen tap 992 1430') | |
# second tap | |
time.sleep(3) | |
swipe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment