Automator | Adb Enable

adb shell input text "Hello"

# Enable automator on connected device
adb enable-automator --grant-permissions
#!/bin/bash
# ADB Enable Automator - Instagram Liker

PACKAGE="com.instagram.android" ACTIVITY="com.instagram.mainactivity.MainActivity"

echo "Launching Instagram..." adb shell am start -n $PACKAGE/$ACTIVITY

echo "Waiting for app to load (3 seconds)..." sleep 3

echo "Tapping the center of the screen to focus video..." adb shell input tap 540 1300 # Adjust coordinates based on your screen resolution adb enable automator

echo "Waiting 2 seconds..." sleep 2

echo "Simulating double tap (Like)..." adb shell input tap 540 1300 sleep 0.1 adb shell input tap 540 1300

echo "Automation complete! Check your phone."

sleep 12 adb pull /sdcard/bug_replay.mp4 adb logcat -d > bug_logs.txt

echo "Bug report generated."

You can simulate taps, swipes, text without any app: adb shell input text "Hello" # Enable automator

# Tap at (500,1000)
adb shell input tap 500 1000

Command:

adb shell automator swipe --from 100,200 --to 100,600 --duration 300
adb shell automator swipe --direction up --on-element <selector>

Behavior:


Some automators (like input command) work without special permissions, but others require INJECT_EVENTS. Grant via:

adb shell appops set <PACKAGE_NAME> android:inject_events allow

Example for Auto.js:

adb shell appops set org.autojs.autojs android:inject_events allow
# Write a simple script
cat > login_test.txt << EOF
wait 2000
tap 540 960
type user@example.com
tap 540 1100
type password123
tap 540 1250
wait 3000
screenshot /sdcard/home_screen.png
EOF