Export for Android
Android export is a preview. It is newer than the desktop export, so expect rough edges. This tutorial covers Development builds, which need no keystore. Release signing needs a keystore and an environment variable, and it is not walked through here.
This tutorial takes about twenty minutes, not counting the downloads. You need Turian and the getting-started tutorial done, plus:
- The .NET SDK with its Android workload:
dotnet workload install android. - The Android SDK and a JDK 17 or newer. Turian finds them where Android Studio and the usual installers put them.
- A phone with USB debugging turned on, or an emulator, running Android 13 or newer with Vulkan 1.3.
1. Create a project
From a terminal, create a fresh project and open it in Studio:
turian-cli new HelloAndroid
turian-studio --project HelloAndroid
Double-click Assets/scene-01.prefab in the Assets panel. It holds the same Camera, Light and Box as in the getting-started tutorial.
2. Add the Android brick
Android is a brick, so a project that does not need it never carries it. Install it from a checkout of the Turian bricks, using the folder that contains its package.json:
turian-cli brick add org.mass4.turian.android file:/absolute/path/to/Bricks/org.mass4.turian.android --project HelloAndroid
turian-cli brick list --project HelloAndroid
The first command prints Installed org.mass4.turian.android with its version. The second lists it among the project's bricks.
3. Check the toolchain
The doctor command reports whether the Android tools are ready, without exporting anything:
turian-cli doctor android --project HelloAndroid
It prints one line that starts with android: READY or android: MISSING, followed by what it found or what is missing. Install whatever it names. If it cannot find the Android SDK or the JDK, set their folders in Studio under Edit → Settings → Build → Android. The command line reads the same settings.
Run it again until the line says READY. Without a platform name, doctor checks every platform.
4. Set the application identity
Android requires a reverse-DNS application identifier, and the build refuses to start without a valid one. A new project starts with com.turian.helloandroid. Open Assets/Settings/PlayerSettings.dataasset and set Application Identifier to your own, such as org.example.helloandroid. It needs at least two parts separated by dots, and each part starts with a letter and may then contain letters, digits and underscores.
The version code defaults to 1, which is valid for a first build. To change it later, add an Android Player Settings asset: its create-menu entry is Settings → Android Player Settings.
5. Add an Android build profile
Open Project → Build Profiles… in Studio, or press Ctrl+Shift+B. Click Add Build Profile and choose Android Client. Then set these fields:
- Name:
Android. The CLI uses this name with--profile, and the export goes toOutput/Android/. - Development: on. A Development build signs with the automatically managed debug keystore, so you need no keystore path or key alias.
- Runtime Identifier: leave it empty for a phone, which uses
android-arm64. If your emulator is an x86_64 image, setandroid-x64.
Select the profile and click Switch Profile if you want it active. The Build & Run command in step 7 uses whichever profile is active.
6. Export the APK
turian-cli export HelloAndroid --profile Android
Turian compiles the scripts, imports the assets, packages the content inside the APK and signs it. The result is a signed package in Output/Android/HelloAndroid/, with a file name that ends in -Signed.apk. Turian checks the settings and the toolchain before it compiles, so a missing identifier or tool stops the export early.
7. Run it on a device
Plug the phone in with USB debugging on, or start an emulator. List what Turian can install on:
turian-cli devices HelloAndroid
The Android section lists each ready device by its serial. Then build a temporary Development player, install it, start it and follow its log in the terminal:
turian-cli deploy HelloAndroid --profile Android --device <serial>
The phone shows the scene with the Box in it. The terminal streams the game's log until you press Ctrl+C, which also stops the game on the phone. Leave out --device when only one device is connected. Engine and game logs also go to logcat under the Turian tag, so adb logcat -s Turian shows them on their own.
In Studio, select the Android profile and click Build & Run in the Build Profiles window, or use Project → Build & Run while the Android profile is active. Both build the same temporary Development player and install it.
Troubleshooting
MISSINGfromdoctor: the line names the missing part, such as the .NET Android workload, the SDK platform or the JDK. Fix that part and rundoctoragain.- Export stops with an application identifier error: set Application Identifier in
PlayerSettings. It needs at least one dot and must start each part with a letter. deployfinds no device: check that the phone or emulator is listed byturian-cli devices. Pass its serial with--devicewhen more than one is connected.
Next steps
- Dedicated server — build a client and a headless server from the same project.
- Async tasks — keep slow work off the game loop.
- Build profiles — every field a profile holds.
- CLI reference — the commands used on this page and the rest.