android-utils
Small Windows console tools for Android development.
install-apk
Installs .apk files on connected devices through adb.
install-apk.cmd app-debug.apk # one device: installs right away
install-apk.cmd # newest .apk in current folder
install-apk.cmd build\*.apk -AllDevices # every connected device
install-apk.cmd app.apk -Serial emulator-5554 -AllowDowngrade -GrantPermissions
You can also drag .apk files onto install-apk.cmd in Explorer.
With two or more devices connected it asks which one to use:
2 devices connected:
[1] OnePlus PLU110 (Android 16) Wi-Fi adb-3B665Q00JXB00000-k5AAKR (2)._adb-tls-connect._tcp
[2] motorola moto g31(w) (Android 12) Wi-Fi adb-ZY22G82WF7-57csgf._adb-tls-connect._tcp
[A] all devices
[Q] cancel
Select device(s), e.g. 1 or 1,2:
Explorer integration
Double-click register-shell.cmd (current user only, no admin) to add Install on Android device for .apk files:
- right-click > Open with > Install on Android device
- right-click > (Windows 11: Show more options) > Install on Android device
- right-click > (Windows 11: Show more options) > Install on WSA (only added when WSA is installed)
It does not change the default app for .apk. It points at the current folder, so re-run it after moving the repo.
Remove with register-shell.cmd -Uninstall.
| Option | adb flag | Meaning |
|---|---|---|
-Serial <id> | -s | Target device. Falls back to ANDROID_SERIAL, then a picker if several are connected |
-AllDevices | Install on every ready device | |
-AllowDowngrade | -d | Allow a lower versionCode |
-GrantPermissions | -g | Grant all runtime permissions |
-AllowTestPackages | -t | Allow testOnly APKs |
-AdbPath <file> | Explicit adb.exe | |
-Wsa | Install on Windows Subsystem for Android (starts it if needed) | |
-WsaPort <n> | WSA adb port, default 58526 |
WSA (Windows Subsystem for Android)
Enable WSA Settings > Advanced settings > Developer mode once, and accept the "Allow USB debugging" prompt the first time.
- A running WSA is connected automatically and listed in the device picker as
WSA. install-apk.cmd app.apk -Wsagoes straight to WSA: it starts WSA, waits for its adb port and authorization, and skips the picker.
adb is looked up in this order: -AdbPath, PATH, ANDROID_HOME, ANDROID_SDK_ROOT, %LOCALAPPDATA%\Android\Sdk.
Existing installs are always replaced (-r). Exit codes: 0 ok, 1 an install failed, 2 setup error (no adb, no device, missing APK).