Claude Code Web · Android
One-line Android setup
Installs the android CLI, JDK 21 Temurin, and the latest stable Android SDK (currently android-37). Paste into a Claude Code Web cloud environment's Setup script field, or run on any macOS / Linux machine with bash. Sourcing via process substitution means env vars land in the calling shell and every new Claude session inherits them automatically.
. <(curl -fsSL https://premex.se/android/install.sh)Need a different JDK, compileSdk, NDK, or CMake? Customize below ↓
Customize for your project
If your project pins a specific JDK, compileSdk, or needs native tooling, pick the versions here and copy the generated script.
Step 1
Pick a JDK distribution
Temurin (Eclipse Adoptium) is the safest default for Android.
Step 2
JDK major version
Available for Temurin: 8, 11, 17, 19, 20, 21, 25
Step 3
Android compileSdk
Latest stable: android-37. Match the compileSdk in your project's build.gradle.kts.
Defaults to 37.0.0; pick a higher patch level if your project pins one.
Step 4 (optional)
Native build tooling
Skip these unless your project has C/C++ sources.
Passed verbatim to android sdk install.
Useful when the cloud env clones the repo after this script runs.
Step 5
Your ready-to-use script
Updates live as you change the selections above.
Cloud-env setup script (paste into Claude Code Web)
#!/bin/bash
export JDK_VERSION=21
export COMPILE_SDK=37
. <(curl -fsSL https://premex.se/android/install.sh)One-liner (for terminals / CI)
curl -fsSL https://premex.se/android/install.sh | JDK_VERSION=21 COMPILE_SDK=37 bashSet it up in Claude Code Web
Two steps: paste the one-liner into your cloud environment, then start a session and confirm.
Configure the environment
- Open your cloud environment in Claude Code on the web.
- Set Network access to Full.
- Paste the one-liner into the Setup script field.
- Save changes.
Update cloud environment
Changes to your environment will apply to new sessions.
Name
Network access
Environment variables
GIT_AUTHOR_NAME=Your Name
Setup script
Bash script that runs when a new session starts, before Claude Code launches.
#!/bin/bash
. <(curl -fsSL https://premex.se/android/install.sh)Start a session and verify
Start a new session and ask Claude is android sdk installed and android home env set? — you should see the SDK, ANDROID_HOME, and the tools all confirmed:
Initialized session
- Set up a cloud container
- Cloned repository
- Ran setup script
- Started Claude Code
Yes — the Android SDK is installed and the environment is configured.
ANDROID_HOME:/root/Android/SdkandroidCLI on PATH;adbandsdkmanageravailable
| Package | Version |
|---|---|
build-tools | 36.0.0 |
cmdline-tools/latest | 20.0.0 |
platform-tools | 37.0.0 |
platforms/android-36 | 2.0.0 |
The script writes ~/.premex-android-env as the source of truth and propagates it via four channels: /etc/profile.d/ for login shells, the standard rc-files for interactive shells, and a SessionStart hook in ~/.claude/settings.jsonso Claude Code Web's per-session bash -c picks up JAVA_HOME, ANDROID_HOME, and the SDK paths automatically — no manual source needed in new sessions.
Need something the picker doesn't list?
The picker covers the versions Google's android CLI currently advertises plus the JDK casks shipped via Homebrew. If you need an older SDK, an experimental preview, or a less common distribution, list what's available end-to-end:
Android SDK packages
curl -fsSL https://premex.se/android/install.sh | bash -s -- list-sdkJDK versions and distributors
curl -fsSL https://premex.se/android/install.sh | bash -s -- list-jdkRun these locally, copy the package id you want into the Extra SDK packages field above (for SDK packages) or paste it after JDK_DISTRO= (for JDKs).
Running locally
The same one-liner works on any macOS (arm64, x86_64) or Linux x86_64 machine. When invoked from inside an Android project, the script also scans $PWD for compileSdk and JDK toolchain hints in build.gradle.kts, libs.versions.toml, and .tool-versions, and uses those if no env vars are set. Re-running is safe — it skips anything already installed.