Loading lessons...
Mobile & Web Targets
Mobile & Web Targets
Mobile devices and web browsers present memory and resource constraints that require platform-specific settings.
Android Builds (.apk / .aab)
- Android SDK/NDK: Unity Hub installs these automatically.
- Gradle: Unity uses Gradle to build Android applications. You can customize Gradle templates under Player Settings -> Publishing Settings.
- Build Formats:
- APK: A single package file for installing directly on test devices.
- AAB (Android App Bundle): Required for uploading to Google Play. It splits resource assets so users only download files matching their device's CPU and resolution, saving space.
iOS Builds
- Xcode Requirement: You cannot compile an iOS binary directly on Windows. Unity generates an Xcode Project folder.
- You must copy this folder to a macOS computer and use Xcode to compile, sign (using an Apple Developer account), and upload the binary to the App Store.
WebGL Targets
- Compilation: Converts C# scripts to WebAssembly (Wasm) and outputs HTML/JS files that run inside browsers.
- Memory Limits: Browsers restrict memory access. Avoid high RAM allocations.
- WebGL Templates: You can choose different templates (default, minimal) or write custom HTML wrappers.
- Threading: WebGL does not support C# multithreading out of the box. Jobs run in single-threaded mode unless WebGL Web Workers are configured.
TL;DR
- Android builds use Gradle, outputting APKs for testing and AABs for Google Play.
- iOS builds generate Xcode projects that must be compiled on macOS.
- WebGL converts code to WebAssembly for browser play.
- Keep assets small for mobile and web builds to avoid memory errors.