Try emulator, thumb zone, offline or share csv.

2 min readUpdated November 2026

Commands and options

Every way to run android_scaffold, every option, and the plain Gradle and adb commands it runs for you.

Usage

python3 android_scaffold.py <source> [options]

<source> is a folder of .kt files, searched recursively, or a single .kt file. Rerunning any command is incremental: the existing project is reused and only changed files are copied.

Common commands

python3 android_scaffold.py <source>                      # generate or refresh the project
python3 android_scaffold.py <source> --build-apk          # and build the APK
python3 android_scaffold.py <source> --run                # and install and launch
python3 android_scaffold.py <source> --watch              # and reload on every save
python3 android_scaffold.py <source> --list-emulators     # list installed emulators
python3 android_scaffold.py <source> --start-emulator     # boot the first emulator
python3 android_scaffold.py <source> --start-emulator Pixel_8_Pro_API_33

Options

OptionDefaultDescription
-o, --output./android_buildWhere the generated project goes. You can also open it in Android Studio.
-n, --nameThumbInventoryApp name shown under the launcher icon.
--apk-dirapk/ next to the sourceWhere a copy of the built APK is placed.
--build-apkoffBuild the debug APK.
--runoffBuild, install and launch on a phone or emulator.
--watchoffLike --run, then rebuild, reinstall and relaunch whenever a .kt file changes. See live reload.
--start-emulator [AVD]offBoot an emulator, optionally by name, and wait until it has finished booting.
--list-emulatorsoffList installed Android Virtual Devices and exit.

Which device is used

For --run and --watch, a phone or emulator that adb already sees is used as is. Otherwise the named AVD, or the first installed one, is booted and the script waits for it to report that boot has completed.

The same steps by hand

After every run the script prints a cheat sheet of the commands it uses, filled in with your paths. They are ordinary Android tooling, so you can run them yourself or in CI:

emulator -list-avds
emulator -avd Pixel_8_Pro_API_33 &
adb wait-for-device

cd android_build
./gradlew assembleDebug
./gradlew installDebug
adb shell am start -n com.example.tapcounter/.MainActivity

On Windows use .\gradlew.bat. The debug APK is written to android_build/app/build/outputs/apk/debug/app-debug.apk.

Reading the output

PrefixMeaning
[*]A step is starting, or information about the project.
[+]A step succeeded.
[!]Something failed. The message says what to do next; see also troubleshooting.

Environment variables

VariableUsed for
ANDROID_HOMELocation of the Android SDK. Checked first.
ANDROID_SDK_ROOTOlder name for the same thing. Checked second.
JAVA_HOMEThe JDK Gradle runs on. Must be 17 or newer.