Android build setup
Assets/
Scenes/
Scripts/
Prefabs/
Project settings
you already havethis lesson adds
You have a game worth shipping: Arena.unity, grown from tab 01 to tab 04, with Intro.unity in front of it. Nothing in either scene has ever run outside the editor. This tab fixes that.
Before you can build anything, Unity needs the Android module, an SDK, an NDK and a JDK. Unity Hub installs all four for you if you let it.
From your project to a file the phone can install — this is the whole pipeline.
Install the module
- 1
Unity Hub → Installs → the gear on your version → Add Modules.
- 2
Tick Android Build Support, and both children: Android SDK & NDK Tools and OpenJDK.
- 3
Both children matter. Installing only the parent gives you the confusing 'Android SDK not found' error later.
- 4
It downloads several gigabytes. Do it before you need it, not the night before a demo.
Switch the platform
- 1
(older Unity: Build Settings) → Android → Switch Platform.
- 2
Unity re-imports and recompresses every texture for mobile. On a large project this takes 10–40 minutes, once.
- 3
Check the scene list: Intro at index 0 and Arena at index 1, as you set it up in tab 01. The app always opens on index 0.
- 4
Switching back to PC later re-imports again — so pick a platform and stay on it while you work.
Prepare the phone
- 1
Settings → About phone → tap Build number seven times. You are now a developer.
- 2
Settings → Developer options → enable USB debugging.
- 3
Plug it in with a data cable — many charging cables carry no data at all.
- 4
Accept the 'Allow USB debugging' prompt on the phone screen and tick Always allow.
Verify with adb
# adb lives inside the Unity Android SDK folder
# macOS example path
# /Applications/Unity/Hub/Editor/<version>/PlaybackEngines/AndroidPlayer/SDK/platform-tools
adb devices
# List of devices attached
# R58M12ABCDE device <- good
# R58M12ABCDE unauthorized <- accept the prompt on the phoneBuild And Run once, right now
Do not wait until the game is finished. Build an empty scene to your phone today so you find the setup problems while you still have time.
The first build compiles every script into C++ and can take 10–20 minutes. Later builds are far quicker.
Choose a build output folder outside your project — Builds/ next to Assets/, and put it in .gitignore.
If it fails, read the last 30 lines of the Console. The real error is almost never the last line.