A fixed route from "my web game is playable" to "my game is on Google Play". For a game in HTML and JavaScript (for example with vite) that becomes an Android app with Capacitor. Every step is a command or an action in the Play Console. Skip none.
How to use this
This guide is written for you and for your agent (Claude Code, Codex or another).
- Put this file in the folder of your game, for example as
docs/ANDROID-LAUNCH.md. - Tell your agent: "Read docs/ANDROID-LAUNCH.md and prepare this game for Android, up to the development build on my phone."
- The steps in the Play Console you take yourself, in your browser. The agent can talk you through them.
You type the password of your upload key yourself. Let the agent prepare the command. It then asks for the password itself, and the agent does not see it. Keep it in a password manager.
What you need
- Node.js, and your game as a web project that builds with one command (for example
vite buildintodist/). - Android Studio, or the Android SDK and a JDK (21) on their own, with
adbandkeytool. - An Android phone with developer options and USB debugging on, or wireless debugging.
- A Google Play developer account (a one-time registration).
- A privacy policy at an address of your own, also when your game collects nothing.
1. Preparing the project (once per game)
-
Add Capacitor:
npm i @capacitor/core @capacitor/android @capacitor/app npm i -D @capacitor/cli npx cap init "<Name>" <package-name> --web-dir dist npx cap add androidThe package name (for example
com.yourstudio.name) stays the same forever. Choose it well. -
Two versions side by side. Give
android/app/build.gradletwo kinds of builds:- a development build (debug) with
applicationIdSuffix ".dev"and the name " Dev", which sits next to the store version on your phone; - a public build (release), signed with your upload key.
Set the label through
manifestPlaceholders, and inAndroidManifest.xmlandroid:label="${appLabel}"on the application and the activity. Read the version frompackage.json:versionNameis the version,versionCodea number that must go up with every upload. - a development build (debug) with
-
A build script (
tools/android.mjs) with two commands, and inpackage.json:"apk": "node tools/android.mjs apk", "aab": "node tools/android.mjs aab", "bump": "npm version patch --no-git-tag-version"apkdoes: web build,npx cap sync android,gradlew assembleDebug,adb install -r.aabdoes: web build,npx cap sync android,gradlew bundleRelease. Always build through these two, never with gradle on its own (see "Learned"). -
The dev server leaves Android alone. Set
server.watch.ignored: ['**/android/**', '**/dist/**', '**/release/**']invite.config.js. Otherwise the dev server crashes (EBUSY) as soon as gradle builds. -
The upload key, in a folder outside the project:
keytool -genkeypair -v -keystore "<keys-folder>/<name>-upload.jks" -alias <name> -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=<Studio>, O=<Studio>, C=<country>"keytoolasks for the password itself. Then writeandroid/keystore.properties:storeFile=<path to>/<name>-upload.jks storePassword=<password> keyAlias=<name> keyPassword=<password>Put
android/keystore.propertiesand*.jksin.gitignore, and back up the keys folder. Lost is lost. -
android/local.propertieswithsdk.dir=the path to your Android SDK (in.gitignoretoo). -
Icons: an adaptive icon (foreground, background, monochrome) per density in
android/app/src/main/res/mipmap-*, and a 512×512 PNG for the store. -
Full screen and portrait: immersive full screen in
MainActivity.java, andandroid:screenOrientation="portrait"in the manifest. -
No dark band at the top. In
capacitor.config.json:"plugins": { "SystemBars": { "insetsHandling": "disable", "hidden": true } }Otherwise Capacitor 8 on Android 15 and newer pads the WebView with a band for the status bar.
-
Game Mode off. Put
android:appCategory="game"on<application>, with this meta-data:<meta-data android:name="android.game_mode_config" android:resource="@xml/game_mode_config" />and in
res/xml/game_mode_config.xml:<game-mode-config xmlns:android="http://schemas.android.com/apk/res/android" android:allowGameDownscaling="false" />Otherwise Samsung Game Booster renders the store version at 75 % on phones with a WQHD+ screen, and the WebView zooms out as soon as something slides out of view: everything small, top left. See "Learned".
-
A changelog in
docs/CHANGELOG.md: per version a block## <version>with the changes in every language of the store, in whole sentences. -
A release kit (
tools/release-kit.pyor.mjs) that makes a folderrelease/<version>/per version with the.aab, the store texts, the screenshots, andrelease-notes.txtin the format of the Console:<en-US> ... </en-US> <nl-NL> ... </nl-NL>Let the kit refuse when the block for the version is missing from the changelog.
2. The development build (daily)
npm run apk
Builds, syncs and installs " Dev" on the phone, next to the store version. adb devices must
show the device. Testing without a phone: npx vite --host, and on the phone
http://<ip-of-the-pc>:<port>/.
3. The public build
npm run bump # version +1: Play requires a higher versionCode with every upload
# now write the block ## <version> in docs/CHANGELOG.md
npm run aab # signed .aab
python tools/release-kit.py # release/<version>/ with .aab, release-notes.txt, texts, screenshots
Only start in the Console once the folder release/<version>/ really exists.
4. The Play Console (once per game)
- Create the app: name, default language (English reaches the most people), game, free or paid, the declarations.
- Accept Play App Signing. Google keeps the real key; you upload with the upload key. The first upload records the upload key.
- The tasks on the dashboard:
- Store listing: short description (80 characters), full description, icon 512×512, feature graphic 1024×500, at least two phone screenshots (9:16, 1080×1920 or larger), tablet ones if you like. Then add translations, with screenshots in that language.
- Made with AI? On upload the Console asks per item whether it was made or edited with AI. Real recordings of your game are not labelled; an icon or illustration made with an AI image tool is. Labelling is a statement, not a rejection.
- Privacy policy: its address, also when the app collects nothing.
- App access, ads, content rating (the questionnaire), target audience (13+ is the simplest; younger brings extra requirements), data safety, category, contact address.
- Internal test: testers (a list of e-mail addresses), new release, upload the
.aab, paste the contents ofrelease-notes.txt, save, review, roll out. Testers get a link to join; usually they can install within minutes. - The pre-launch report, after about an hour: real devices, crashes, screenshots, accessibility. No crashes, then on to a closed test or production. According to Google, a personal developer account first has to run a closed test with a minimum number of testers for a while before production opens: look in the Console at what applies to your account.
- Every next version: the steps of chapter 3, then in the Console a new release, the
.aabfromrelease/<version>/, paste the release notes, roll out. - Then also send it for review. The publishing overview has a button to send the changes for review. Without that click the release stays where it is. Every update is reviewed too, usually within hours.
- "Version code has already been used": that code was already in the app's library (a
discarded draft counts too). Do not look for why:
npm run bump, rename the changelog block,aaband the kit again. - The release notes of a live release cannot be changed, only with a new release.
- When you are on the list of testers yourself, the store page tells you that you are a tester, also when production is live. That is not a mistake.
Rhythm: not every small change to production. The development build daily, testers through the internal test, production gets releases that bundle changes. Only a crash fix goes at once.
5. Material for the store
- Screenshots in the language of the listing. Set the game to that language and take them on
the phone (
adb exec-out screencap -p > shot.png), or let a script take them. - Feature graphic 1024×500: your logo or game heading on a field of colour; no text needed.
- Description: two or three sentences on what the game is, three bullet points, no promises about prices or performance.
- Video: see the guide Promo videos of your game.
6. In the game itself
- Put a button in the About screen to your developer page on Google Play
(
https://play.google.com/store/apps/dev?id=<your-id>), so that players find your other games. - Check on a tablet or a wide screen that buttons such as close really are where they belong.
7. Checklist before every public build
- tests green, the development build played on at least one phone
-
android:appCategory="game"andgame_mode_config.xmlin the manifest - version raised, and the About screen shows that version
-
npm run aabwithout a warning about signing - release notes in every language in
docs/CHANGELOG.md, andrelease/<version>/release-notes.txtexists - the pre-launch report read: no crashes, small screens fine
-
git tag v<version> - in the Console, after rolling out, also sent for review
- after going live, the store version itself tested, not the development build: cold start, play, settings, the win screen, the About screen
8. Learned in production
- The store version behaves differently from the development build. Only an install from Google
Play counts as a game for Android. Samsung Game Booster then renders games at 75 % on phones with
a WQHD+ screen and stretches the picture; the WebView then zooms out the whole page as soon as
something sticks out of view for one frame, such as a panel that slides in. A development build
through adb is not affected and so proves nothing. The fix: step 10 of chapter 1, and the rule
below. You can reproduce it with
adb shell cmd game. - An element centred with
transform: translateX(-50%)gets an animation of its own that repeats that translate. An animation with onlytranslateYorscaleoverrides the centring and makes the element stick out to the right for one frame. - The sound crackles when going to the home screen and when closing. In the Capacitor WebView,
visibilitychangedoes not fire when the app goes to the background, so Web Audio plays on until Android cuts it off hard. The fix: one master bus for effects and music; onpauseof@capacitor/appfade that bus out in 80 ms andctx.suspend(), onresumeresume()and fade in again. A close button fades first and only then callsApp.exitApp(). - A fix was in the source, but in no app. Gradle run on its own without
cap synctakes the web files of the previous sync along. Always build withnpm run apkornpm run aab; after gradle on its own, firstnpx cap sync android. Check it withunzip -p <apk> 'assets/public/assets/*.css' | grep -c <something from your fix>. A fix is only done when the new version is in the Console; read the version on the phone withadb shell dumpsys package <package-name> | grep versionName.

