Try emulator, thumb zone, offline or share csv.

3 min readUpdated November 2026

Install android_scaffold

android_scaffold is one Python file. Setting it up means having three things it drives: Python, a JDK and the Android SDK. If you've ever installed Android Studio, you probably have all three already.

Key takeaways

  • You need Python 3.8+, JDK 17 or newer, and the Android SDK.
  • The script uses only the Python standard library: there is nothing to pip install.
  • For --run and --watch you also need an emulator or a phone with USB debugging on.

Requirements

RequirementDetails
Python3.8 or newer. Standard library only.
JDK17 or newer, on PATH or set with JAVA_HOME.
Android SDKFound through ANDROID_HOME or ANDROID_SDK_ROOT, or the default Android Studio location on macOS, Windows and Linux.
InternetFirst build only, to fetch the Gradle wrapper and dependencies. Later builds work offline.
DeviceAn Android Virtual Device (emulator) or a phone with USB debugging, for --run and --watch.

1. Get the script

Clone the repository to get the script and the Thumb Inventory example app:

git clone https://github.com/android-shop/android-shop.github.io.git android_scaffold
cd android_scaffold

Or download just the script and put it anywhere. It has no dependencies outside the Python standard library:

curl -LO https://android-shop.github.io/android_scaffold.py

Direct link: android-shop.github.io/android_scaffold.py · view on GitHub

2. Install JDK 17 or newer

Check what you have:

java -version

If it reports a version below 17, or the command is missing, install a current JDK such as Eclipse Temurin or the one bundled with Android Studio, then make sure it is on your PATH or that JAVA_HOME points at it.

Tip

Android Studio ships its own JDK. On macOS it lives at /Applications/Android Studio.app/Contents/jbr/Contents/Home, which you can use as JAVA_HOME.

3. Install the Android SDK

The simplest route is to install Android Studio once and let its setup wizard download the SDK, platform tools and an emulator image. android_scaffold looks for the SDK in this order:

  1. the ANDROID_HOME environment variable,
  2. the ANDROID_SDK_ROOT environment variable,
  3. the default Android Studio location for your operating system, such as ~/Library/Android/sdk on macOS.

If your SDK is somewhere else, point the script at it:

export ANDROID_HOME="$HOME/Library/Android/sdk"

You can also install the SDK without Android Studio using Google's command-line tools and sdkmanager. You'll need platform-tools, a recent platforms;android-36 and, for an emulator, emulator plus a system image.

4. Set up an emulator or a phone

Emulator

In Android Studio open Device Manager and create a virtual device, for example a Pixel with a recent Android image. Then check that android_scaffold can see it:

python3 android_scaffold.py src --list-emulators

A real phone

Testing on the phone in your hand is the best way to judge a small-screen app: you feel the reach, the haptics and the glare. To use one:

  1. Open Settings → About phone and tap Build number seven times to enable Developer options.
  2. In Settings → System → Developer options, turn on USB debugging.
  3. Connect the phone with a USB cable and accept the "Allow USB debugging?" prompt on the phone.

When a phone is connected, --run and --watch install to it instead of booting an emulator.

5. Check everything works

Build the bundled example app. The first build downloads Gradle and dependencies, so give it a few minutes:

python3 android_scaffold.py src --build-apk

When it finishes you'll have apk/app-debug.apk and a printed cheat sheet of the equivalent Gradle and adb commands. Next: build your own app in the quick start.

Frequently asked questions

Do I need Android Studio to use android_scaffold?

No. You need the Android SDK, a JDK and Python. Installing Android Studio is simply the easiest way to get the SDK and an emulator; after that you can work entirely from the terminal and your own editor.

Do I need to pip install anything?

No. android_scaffold uses only the Python standard library, so any Python 3.8 or newer can run it directly.

Which operating systems are supported?

macOS, Linux and Windows. The script detects the default SDK location on each and uses gradlew.bat on Windows.