Web app and API to remotely control an Android device with adb and UI Automator.
I wanted to automate a few processes on my Android phone, triggerable from a web app, or from other scripts. This project is essentially an HTTP wrapper around adb for basic actions, and UI Automator to tap and interact with elements on screen.
By using UI Automator (similar to Appium or Espresso), automations executed by Droid Remote work for practically any app, including those using FLAG_SECURE. This includes most banking apps, as well as Belgium's de-facto digital identity provider: itsme.
General
- Termux compatible
- Web app and API
- HTTP Basic Auth. username:
admin
, password:<set with http-basic-password option>
- Automatically manages Ngrok tunnel (use
ngrok_domain
option) - Watchdog service
Basic device controls:
- Wake up
- Battery & idle status
- Termux wake lock
- Screen brightness
- Reboot
Adb and app management:
- ADB pair and connect (using Tasker IPC)
- Start Tailscale VPN
- Prepare device for automation (wake lock, set screen brightness, connect ADB)
UI Automator debugging:
- Read device screen hierarchy
- Tap on screen coordinates
- Take screenshot
Itsme:
- Open/force close Itsme app
- Parse any screen (home, action, pinpad...)
- Accept or reject action
- Enter PIN
- Automatically accept action and enter PIN for given known action
git clone https://github.com/ubipo/droid-remote.git
cd droid-remote
python3 -m venv .env
source .env/bin/activate
(or similar for your shell)pip install -r requirements.txt
In foreground
python3 -m droid_remote foreground
As a daemon service
python3 -m droid_remote start
python3 -m droid_remote stop
python3 -m droid_remote restart
python3 -m droid_remote status
Using the watchdog service
python3 -m droid_remote foreground --watchdog
python3 -m droid_remote start --watchdog
python3 -m droid_remote stop --watchdog
python3 -m droid_remote restart --watchdog
python3 -m droid_remote status --watchdog
Use:
python3 -m droid_remote --help
...to see all available options.
Options can be set using either (from highest to lowest precedence):
- Command line arguments:
--name-of-option VALUE
.env
file:DR_NAME_OF_OPTION=VALUE
- Environment variables:
DR_NAME_OF_OPTION=VALUE