ubipo / droid-remote

Control Android over HTTP 🤖🕹️

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Droid Remote 🤖🕹️

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.

Features

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

Setup

  1. git clone https://github.com/ubipo/droid-remote.git
  2. cd droid-remote
  3. python3 -m venv .env
  4. source .env/bin/activate (or similar for your shell)
  5. pip install -r requirements.txt

Running

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

Configuration

Use:

python3 -m droid_remote --help

...to see all available options.

Options can be set using either (from highest to lowest precedence):

  1. Command line arguments: --name-of-option VALUE
  2. .env file: DR_NAME_OF_OPTION=VALUE
  3. Environment variables: DR_NAME_OF_OPTION=VALUE

Screenshots

Device controls Device controls in the web app

Itsme automation Itsme automation in the web app

About

Control Android over HTTP 🤖🕹️


Languages

Language:Python 78.5%Language:JavaScript 15.0%Language:HTML 6.5%