How to build an APK on your Android phone, no PC needed
Yes, you can compile an APK on an Android phone. What PocketCode builds today (Kotlin, Compose, release APKs, AABs), how long it takes and its limits.
Yes. PocketCode compiles an Android app written in Kotlin into an APK, or into the AAB bundle that Google Play asks for, on the phone itself. You don't need a computer, Android Studio, Gradle or a cloud build server, and building is free. The first build downloads about 119 MB of build tools from Google Play. Before you start, know the limits: Kotlin only, build.gradle.kts only, and no Flutter or React Native.
I build PocketCode, so keep that in mind as you read. The timings below come from my own tests on a Galaxy S24, and I say where each one comes from.
What you can build on the phone today
PocketCode has two Android templates under New project: Android app (Activity) and Android app (Compose). Both are standard Gradle projects, so the same folder opens in Android Studio if you move to a computer later.
From a project like that you can build three things:
| Choice in the app | What it is for |
|---|---|
| Debug APK | Trying the app on your phone. Signed with a debug key. |
| Release APK | Sharing the app outside Google Play. Optimized and signed with your own key. |
| Release bundle (AAB) | Uploading to Google Play Console. It cannot be installed on a phone. |
You can also use libraries from Google Maven and Maven Central, declared in app/build.gradle.kts or in a libs.versions.toml catalog. They download on the first build and stay on the phone.
For release builds the app can create your key (RSA 2048, valid for 30 years) or import a .p12 or .pfx file, and it can export a copy that Android Studio and keytool open. If the release block has isMinifyEnabled = true, R8 shrinks and obfuscates the code. You can leave the app while it compiles, and a notification shows that the build is still running.
How it works without Gradle
PocketCode doesn't run Gradle on the phone. It has its own build chain inside the app: kotlinc with the Compose compiler plugin for your code, aapt2 for resources, d8 or R8 for the dex files, and apksig to sign the result.
To know what to build, it reads the parts of app/build.gradle.kts that a typical app uses: namespace and application ID, SDK versions, version code and name, dependencies, the Compose switch and the release block. If it finds something it can't handle, such as a Gradle plugin, KSP, kapt or product flavors, the build fails and the sheet lists each one as "Not supported on the phone yet", with the file and the line.
Build your first APK, step by step
- Install PocketCode from Google Play. The build tools are delivered through Google Play, so a copy installed from a file can't get them.
- Open Projects, tap New and pick Android app (Compose) or Android app (Activity).
- Open the project and tap Build APK, the Android icon in the editor toolbar. It only appears in Android projects.
- In the Build the app sheet, choose Debug APK and tap Build.
- The first time, the sheet shows "Getting the build tools" while Google Play downloads them (about 119 MB). On mobile data, Google Play may ask for your OK first.
- When you see APK ready, tap Save to Downloads. The file goes to
Downloads/PocketCode/with the project's name. Share… sends it to another app instead. - Open the APK from the Files app. Android asks once for permission to install apps from unknown sources. Allow it and install.
PocketCode never installs the APK for you; Android does that from the Files app. The APK build guide covers every screen, release keys, R8 and the error messages.
How long it takes
All of these were measured on a Galaxy S24.
With PocketCode installed from Google Play, the first debug build of the Compose template took 1 min 25 s, including the one-time download of the build tools. The APK was 7.8 MB. A release build of the same template with R8 took 44 s and gave a 1.2 MB APK.
Later builds are much faster because the tools and the libraries are already on the phone. In my test runs, rebuilding the Compose template with everything cached took 3.4 s. The Activity template, which has no libraries to download, took 9.2 s the first time (not counting the tools download) and under a second after that. Those runs used a debug build of PocketCode, which is slower than the version on Google Play.
A slower phone will take longer. These are measurements from one phone, not a promise.
The limits
- Kotlin only.
.javasource files are not compiled yet. - Only the Kotlin DSL is read. A Groovy
build.gradleis not. - Annotation processors (KSP and kapt) are not supported, so libraries that need them, such as Room or Hilt, won't build.
- Flutter, React Native and Expo build their Android apps through Gradle, so they don't build here.
- The tools need the app installed from Google Play, and the first build needs a connection for the tools and the libraries.
- R8 on a Compose app needs memory, up to about 335 MB on the S24. On a phone with less memory it can fail. A debug build doesn't use R8.
- You need Android 9 or newer, a 64-bit phone and PocketCode 1.1.0 or later.
- I check the AAB format with Google's bundletool in my tests, but I haven't uploaded one of these bundles to a live Play Console listing yet. If Play rejects yours, please send a bug report from the app.
What it costs
Building APKs and AABs, signing with your own key and R8 are free, with no Pro requirement. On the free plan, the limit you will run into is projects: you get one. Pro removes that cap, and you can try Pro for 7 days without a card. When the trial ends you go back to the free plan and nothing is charged. The pricing page lists every limit.
You need a free account to open the app, and the connection is only used to sign in. The AI assistant in the editor can help you write the Kotlin with your own API key, and PocketCode doesn't charge for that.
PocketCode is free on Google Play. Get PocketCode on Google Play, start with the Activity template, which is the lighter of the two, and move to Compose once the first build works.
Frequently asked questions
Can I build an APK on my Android phone without a PC?
Yes. PocketCode compiles a Kotlin Android project into an APK on the phone, with no computer, Gradle or build server. You need PocketCode 1.1.0 or later from Google Play, Android 9 or newer and a 64-bit phone. The first build needs a connection to download the build tools, about 119 MB.
Can I compile an APK without Android Studio?
On the phone, yes. PocketCode uses its own build chain and reads app/build.gradle.kts directly. The projects keep the standard Gradle layout, so you can still open them in Android Studio on a computer.
Is it free to build APKs in PocketCode?
Yes. Debug APKs, release APKs, AAB bundles, your own signing key and R8 are all free. The free plan allows one project, and Pro removes that limit.
How long does the first build take?
On a Galaxy S24, the first debug build of the Compose template took 1 min 25 s, including the one-time download of the build tools. A release build with R8 took 44 s. Other phones will be faster or slower.
Can I build Java, Flutter or React Native apps?
Not today. Java source files are not compiled yet and Groovy build.gradle files are not read. Flutter, React Native and Expo build their Android apps through Gradle, which PocketCode does not run. Write the app in Kotlin with build.gradle.kts.
Can I publish to Google Play from my phone?
PocketCode builds the release bundle (AAB) that Google Play asks for, signed with your own key. You upload it yourself in Google Play Console. Keep a copy of the key and its password, because without them you can't update the app.
Code Editor
Keep reading
- TutorialDcoder shut down: what to use instead on AndroidDcoder shut down on 31 March 2026. What happened, and what to use now on Android for Python, web code or several languages, with the limits of each.7 min
- TutorialAn IDE for Android tablets: what a bigger screen changes, and what to useAn Android tablet with a keyboard can be a real coding machine. What to look for in a tablet IDE, the options, and how PocketCode uses the extra space.5 min
- TutorialApps to code on your Android phone in 2026: which one for whatTermux, Acode, Pydroid 3, Replit, Spck and PocketCode: what each app for coding on an Android phone is good at, what it costs and where it stops.6 min

