This is the lesson that takes you from "it runs on my laptop" to "I handed my phone to a friend and they played it." Once done, you have a reproducible one-command build. You'll invoke it 50+ times before ship โ the investment pays back within a week.
brew install openjdk@17, then follow the post-install sudo ln -sfn note brew prints. Verify with java -version.adb)Note the SDK path โ it's usually ~/Library/Android/sdk. You'll paste it into Godot.
Open Godot. Editor โ Editor Settings โ Export โ Android. Fill in:
/Users/YOU/Library/Android/sdk/opt/homebrew/opt/openjdk@17java -version against what Godot points at.
Android requires every APK to be signed. For testing on your own phone, a "debug" keystore is fine โ it's just a throwaway key. Create one:
cd ~/.godot
keytool -keyalg RSA -genkeypair -alias androiddebugkey \
-keypass android -keystore debug.keystore \
-storepass android -dname "CN=Android Debug,O=Android,C=US" \
-validity 9999 -deststoretype pkcs12
Now point Godot at ~/.godot/debug.keystore in Editor Settings. You'll generate a release keystore later for the Play Store โ that one you guard with your life (if you lose it, you can never update your app).
Export templates are the pre-built platform binaries Godot bundles your game into. Editor โ Manage Export Templates โ Download and Install. ~700MB download, ~2GB on disk. Grab a coffee.
Once installed, templates live in ~/Library/Application Support/Godot/export_templates/4.x.stable/. If you upgrade Godot, re-download.
Project โ Export โ Add โ Android. A preset appears. The key fields:
build/lexicon-duel-debug.apk (create the build/ folder in your project)com.yourname.lexiconduel โ a reverse-DNS identifier. It must be globally unique when you publish. Pick something you'll be okay with forever.Enable developer mode on your Android phone: Settings โ About phone โ tap Build Number 7 times. Then Settings โ Developer Options โ USB Debugging: on.
Plug phone in. First connection will prompt on the phone for authorization โ accept "always allow from this computer." Verify:
adb devices
# Should print:
# List of devices attached
# R58M12ABCDE device
If it prints unauthorized, re-confirm on phone. If it prints nothing, your USB cable may be charge-only (not data) โ swap it.
Back in Godot, you should now see a little Android icon in the top-right next to Play. Click it. Godot builds โ installs โ launches the game on your phone.
Once you have a preset, you don't need the editor UI. This is what you'll actually use 90% of the time:
# In the project root
godot --headless --export-debug "Android Debug" build/lexicon-duel-debug.apk
# Then install to connected device
adb install -r build/lexicon-duel-debug.apk
# Or one-shot:
adb install -r build/lexicon-duel-debug.apk && adb shell am start -n com.yourname.lexiconduel/com.godot.game.GodotApp
Wrap it in a shell script named deploy.sh and put it at the root of your project. That script is your best friend for the next three months.
Godot supports remote debugging over USB. With the phone connected:
print() output, errors, and breakpoints all route back to the editorWithout this, you're printing to the void. Turn it on.
brew install openjdk@17, use that path.adb logcat:
adb logcat -s godot | grep -i error
Most common: missing resource, usually a texture not included in export (check the "Resources" tab in your preset).adb uninstall com.yourname.lexiconduel.deploy.sh. Commit it. You'll thank yourself.