Damru CLI Reference — python -m damru

Every Damru operation — setup, environment checks, container management, browser control, benchmarking, and the local UI — is available through the python -m damru CLI, which runs inside your virtual environment and routes Docker and ADB commands through Linux or WSL automatically.

Run any subcommand with --help for the full flag list. All commands assume an active virtual environment where Damru is installed (see Installation).


Command Overview

CommandCategoryWhat it does
setupSetupGuided first-run config writer and dependency installer
install-depsSetupInstall Linux/WSL dependencies (Docker, ADB, binderfs, iptables)
install-imageSetupLoad the pre-baked damru-redroid:latest Docker image
install-apksSetupDownload/install raw Chrome/WebView/TTS APK bundle
check-envVerificationValidate Linux/WSL tools, Docker, binderfs, image, and assets
check preflightVerificationFast read-only readiness check for fleet/CI use
quick-checkVerificationFast local Android/Chrome sanity check on a running worker
fix-wslRepairRetry safe Docker/binderfs/netfilter repairs
fix-internetRepairRepair WSL/Docker/Android DNS and internet connectivity
wsl-kernel statusRepairInspect bundled/active WSL kernel state
benchmarkTestingRun the benchmark suite against anti-bot targets
bake-imageImageBake a warm Redroid image from raw base + APK bundle
devicesWorkersList ADB devices detected from Linux/WSL
force-profileWorkersApply a named Android device profile to a running worker
open-urlBrowserOpen a URL in Android Chrome on a running ADB worker
stealth-open-urlBrowserApply full Damru stealth, load URL natively, then reattach CDP
screenshotBrowserCapture the Android display as a PNG via ADB
recordBrowserCapture the Android display as an MP4 via ADB
viewBrowserOpen a live scrcpy viewer for a running worker
install-viewerBrowserCheck/install optional scrcpy tooling
uiDashboardOpen the experimental local web dashboard

Setup Commands

setup

Guided first-run setup that installs dependencies, downloads APK assets if needed, and writes a working config.py.

python -m damru setup

Flags:

FlagDescription
-yNon-interactive; accept all prompts automatically
--skip-depsSkip dependency installation (useful after a developer clone)
--wsl-distro <name>WSL distro name (Windows only)
--wsl-username <user>WSL username (Windows only)
--sudo-password-stdinRead one sudo password line from stdin (for CI pipelines)
--confirm-wsl-kernel-riskRequired alongside -y for scripted WSL kernel installs

Examples:

# Interactive guided setup
python -m damru setup

# Non-interactive, specifying the WSL distro and user
python -m damru setup -y --wsl-distro Ubuntu --wsl-username alice

# Non-interactive native Linux with sudo password piped in
printf '%s\n' 'mysudopass' | python -m damru setup -y --sudo-password-stdin

install-deps

Install common Linux/WSL dependencies: ADB, Docker, iptables, curl/wget/git/jq, binderfs mount, and Docker group membership. Idempotent — safe to run repeatedly.

python -m damru install-deps
python -m damru install-deps -y
printf '%s\n' 'mysudopass' | python -m damru install-deps -y --sudo-password-stdin

On later runs (after a WSL restart), install-deps rehydrates Docker and binderfs without reinstalling packages.


install-image

Load the pre-baked damru-redroid:latest Docker image. Auto-detects damru-redroid-latest.tar in the current directory, parent directory, project root, home directory, or ~/Downloads, verifies SHA-256, and runs docker load inside Linux/WSL.

python -m damru install-image

Flags:

FlagDescription
--downloadDownload the image tarball before loading if not found locally
# Load a locally present tarball
python -m damru install-image

# Download and then load
python -m damru install-image --download

install-apks

Download the Chrome/WebView/TTS/resetprop APK bundle (~3.3 GB) and extract it to /home/damru/chrome-apks on Linux/WSL. Needed only for raw/unbaked Redroid, image baking, or APK rotation asset updates. The baked image already includes these assets.

python -m damru install-apks --download

install-apks validates the 143–148 Chrome split-APK folders, copies Damru’s shipped magisk.apk as the local resetprop source, and sets CHROME_APK only when needed.


Verification Commands

check-env

Validate Linux/WSL tools, Docker daemon, binderfs, the baked Redroid image, Chrome asset discovery, and the Playwright crPage.js patch.

python -m damru check-env

Flags:

FlagDescription
--viewerAlso check scrcpy/viewer tooling

check preflight

Fast, read-only readiness check designed for fleet and CI use. Checks host/WSL support, Python/Playwright, Linux tools, Docker daemon and bridge, binder/binderfs, Redroid image, APK bundle, disk/RAM/CPU, ADB devices, port range, config sanity, and WSL kernel status.

Does not install packages, mount binderfs, start containers, or change any networking configuration.

python -m damru check preflight

Flags:

FlagDescription
--jsonOutput results as machine-readable JSON (for deployment tooling)
--strictTreat warnings (physical ADB devices, busy ports, low resources, non-bundled WSL kernel) as failures
--no-adbSkip ADB device detection

Examples:

# Standard check
python -m damru check preflight

# JSON output for CI/fleet scripts
python -m damru check preflight --json

# Fail on any warning (for strict CI pipelines)
python -m damru check preflight --strict

# Skip ADB scan
python -m damru check preflight --no-adb

Useful environment variables for multi-distro/multi-port setups:

# Target a specific WSL distro without editing config.py
DAMRU_WSL_DISTRO="DamruFreshTest" python -m damru check preflight

# Use a different base ADB port if 5600+ is already occupied
DAMRU_REDROID_BASE_PORT="5700" python -m damru check preflight

quick-check

Fast Android/Chrome sanity check on an already-running Redroid worker. Confirms Android boot is complete, Chrome is installed and launchable, DNS is working, and CDP is reachable.

python -m damru quick-check
python -m damru quick-check --serial 127.0.0.1:5600

Repair Commands

fix-wsl

Retry safe Docker, binderfs, routing, and netfilter repairs. Selects a Docker-compatible iptables backend (nft for native Linux, legacy for WSL when nft rejects addrtype NAT rules). Falls back to a no-iptables Docker mode on WSL kernels that lack full Docker bridge/NAT support.

python -m damru fix-wsl

fix-internet

Repair WSL/Docker/Android DNS and internet connectivity for one worker or all online workers.

python -m damru fix-internet

wsl-kernel status

Inspect the state of Damru’s bundled WSL2 kernel and compare it to the currently active kernel. Reports whether the bundled kernel is installed, active, and whether the active kernel supports Docker bridge/NAT and binderfs.

python -m damru wsl-kernel status

Testing and Benchmarking

benchmark

Run the built-in benchmark suite against real anti-bot detection targets. Reproduces the stealth proof results (Sannysoft, CreepJS, Fingerprint Pro, Cloudflare, etc.).

# Run all tests on a random device
python -m damru benchmark --device random

# Run specific tests with a named device and proxy
python -m damru benchmark --device samsung_galaxy_s24_ultra --proxy socks5://ip:port --tests creepjs cloudflare

Image Baking

bake-image

Bake a warm Redroid image from a raw Redroid base container plus the Chrome/WebView/TTS APK bundle. Run this only when you want to create a custom image — normal users should use install-image instead.

python -m damru bake-image --image damru-redroid:latest

After baking, export the image and generate the checksum:

docker save damru-redroid:latest -o damru-redroid-latest.tar
sha256sum damru-redroid-latest.tar > damru-redroid-latest.tar.sha256

The tarball is intentionally Git-ignored because of its size. Keep the checksum file alongside the tarball in your release artifact.


Worker Management Commands

devices

List ADB devices detected from Linux/WSL. Shows TCP Redroid endpoints and any emulator-* serials.

python -m damru devices

force-profile

Apply a named Android device profile to an already-running rooted Redroid worker — without opening a full Playwright session. Applies Android props, timezone, locale, display size/density, CPU core spoofing, native Vulkan GPU spoofing, memory preload, and Chromium command-line/preferences.

python -m damru force-profile --serial 127.0.0.1:5600 --device pixel_8_pro
python -m damru force-profile --serial 127.0.0.1:5600 --device xiaomi_redmi_9a
python -m damru force-profile --serial 127.0.0.1:5600 --device "Xiaomi POCO F5"

Flags:

FlagDescription
--serial <serial>ADB serial of the target worker
--device <slug|name|model>Device profile slug, marketing name, or model string
--locale <BCP-47>Override locale (e.g., pt-BR, en-US)
--timezone <IANA>Override timezone (e.g., America/Sao_Paulo)
--proxy <url>Proxy URL for GeoIP resolution and Android HTTP proxy setup
--browser-package <pkg>Target package for browser profile hardening. Use org.chromium.webview_shell for WebView Shell harnesses
--no-chromeApply only Android/native-level changes; skip Chrome command-line and preferences
--no-gpuDisable native Vulkan GPU layer (isolation testing)
--no-memoryDisable native memory preload layer (isolation testing)
--clear-proxyClear the worker’s current Android HTTP proxy setting

Examples:

# Standard profile force for Chrome automation
python -m damru force-profile --serial 127.0.0.1:5600 --device pixel_8_pro

# Android-level hardening only, no Chrome prefs, clear existing proxy
python -m damru force-profile --serial 127.0.0.1:5600 --device motorola_moto_g_5s_plus --no-chrome --clear-proxy

# WebView Shell harness with locale and timezone override
python -m damru force-profile --serial 127.0.0.1:5600 --device xiaomi_redmi_9a \
  --browser-package org.chromium.webview_shell --locale pt-BR --timezone America/Sao_Paulo

# WebView Shell with proxy
python -m damru force-profile --serial 127.0.0.1:5600 --device pixel_8_pro \
  --browser-package org.chromium.webview_shell --proxy socks5://user:pass@host:port

--browser-package org.chromium.webview_shell writes /data/local/tmp/webview-command-line and patches app_webview/pref_store instead of Chrome’s command-line and app_chrome/Default/Preferences.


Browser Action Commands

open-url

Open a URL in Android Chrome on one ADB worker without applying the full Damru stealth session. Useful for quick manual navigation.

python -m damru open-url --serial 127.0.0.1:5600 --url https://example.com

stealth-open-url

Apply Damru’s full stealth profile setup, disconnect CDP, open the URL through Android Chrome’s native VIEW intent (protected navigation), then reconnect CDP for inspection and further automation.

python -m damru stealth-open-url --serial 127.0.0.1:5600 --url https://example.com

Flags:

FlagDescription
--serial <serial>ADB serial of the target worker
--url <url>URL to open
--mode <mode>Navigation mode: reattach (default), cdp, native, playwright
--cold-startClear Chrome state and rebuild a fresh identity before navigating
--proxy <url>Proxy for this session
--device <slug>Device profile to apply

Mode descriptions:

ModeBehavior
reattach (default)Apply/reuse profile → disconnect CDP → open via am start → reconnect CDP
cdpCDP-side overrides stay live during the native open
nativeLeave CDP detached after opening
playwrightRaw Playwright page.goto path (debug only)

Reuses existing Chrome/profile state by default for fast repeated opens. Pass --cold-start when a fresh Chrome identity is needed.


screenshot

Capture the full Android display as a PNG through ADB.

python -m damru screenshot --serial wsl:127.0.0.1:5600 --output screen.png

On native Linux the serial is 127.0.0.1:5600; on WSL2 it is wsl:127.0.0.1:5600.


record

Capture the Android display as an MP4 through ADB.

python -m damru record --serial wsl:127.0.0.1:5600 --time-limit 30 --output clip.mp4

view

Open a live scrcpy viewer for a running Redroid worker. Scrcpy must be installed first (see install-viewer).

python -m damru view --serial wsl:127.0.0.1:5600

Flags:

FlagDescription
--serial <serial>ADB serial of the worker to view
--no-controlWatch-only mode — keyboard/mouse/touch input is disabled

If --serial is omitted, Damru uses the first online ADB device.

# Live view with control
python -m damru view --serial wsl:127.0.0.1:5600

# Watch-only mode (safe to use during automation runs)
python -m damru view --serial wsl:127.0.0.1:5600 --no-control

install-viewer

Check for and install the optional scrcpy tooling required by the view command.

python -m damru install-viewer
python -m damru check-env --viewer

Dashboard

ui

Open the experimental local web dashboard at http://127.0.0.1:<port>. The UI is local-only by default and uses an allowlisted backend.

python -m damru ui

The dashboard provides:

Work Lab URL navigation uses stealth-open-url in default reattach mode. The UI is intended for setup, debugging, and manual inspection — use AsyncDamru or DamruPool for production automation. See the upstream UI.md for screenshots.


ADB Serial Format

HostSerial format
Native Linux127.0.0.1:5600, 127.0.0.1:5601, …
WSL2wsl:127.0.0.1:5600, wsl:127.0.0.1:5601, …

The wsl: prefix is automatically stripped on native Linux hosts. Damru refuses to auto-select physical-looking USB serials by default. Set DAMRU_ALLOW_PHYSICAL=1 only for an intentionally disposable test device.