Creating a game in Unity is just half the battle. Once developers have designed, programmed, and tested their masterpiece, the crucial next step is building and exporting it for their target platforms. This comprehensive guide from NKB Playtech will walk through the entire process of preparing, building, and exporting Unity games for both Android mobile devices and Windows computers.
Whether creating a casual mobile game or an immersive desktop experience, this guide covers everything from setting up development environments to optimizing the final build and distributing the finished product. Let’s dive into transforming that Unity project into a playable game that reaches audiences worldwide.
Understanding the Build Process
Before jumping into platform-specific instructions, it’s important to understand what happens during Unity’s build process.
What Happens When Unity Builds a Game
When a developer hits that “Build” button, Unity performs several crucial operations:
- Asset Processing: Unity processes all assets in the project, applying compression and optimization settings.
- Code Compilation: All scripts get compiled for the target platform.
- Scene Bundling: All scenes included in the build settings are packaged.
- Libraries and Dependencies: Unity packages necessary libraries and dependencies.
- Platform-Specific Packaging: The build is wrapped in platform-appropriate formats (APK/AAB for Android, EXE for Windows).
Common Build Settings Across Platforms
Regardless of the target platform, several key settings affect all builds:
- Included Scenes: Only scenes added to the build settings will be included.
- Compression Methods: Different compression options affect file size and loading times.
- Scripting Backend: IL2CPP vs Mono choices impact performance and compatibility.
- API Compatibility Level: .NET Standard 2.0 vs .NET Framework provides different library access.
- Development Build: Enables debugging features at the cost of performance.
The team at NKB Playtech recommends starting with a development build for testing, then switching to a release build for final distribution.
Setting Up Your Unity Project for Building
Before diving into platform-specific builds, proper project setup is essential for a smooth process.
Project Configuration Best Practices
Following these best practices helps prevent common build issues:
- Version Control: Ensure the project is properly saved and committed to version control.
- Asset Organization: Clean up unused assets and organize folders logically.
- Resolve Warnings: Address any console warnings before building.
- Check Dependencies: Verify all packages and assets are compatible with target platforms.
- Update Unity: Use the recommended Unity version for target platforms.
Essential Pre-Build Checklist
The experienced developers at NKB Playtech suggest completing this checklist before every build:
- ✓ All scenes are added to the build settings in the correct order
- ✓ Player settings are configured for the target platform
- ✓ Graphics settings match target device capabilities
- ✓ Project assets are properly compressed
- ✓ Third-party SDKs and plugins are up-to-date
- ✓ Test build on the development machine first
Building for Android: Step-by-Step
Android represents a massive market for game developers, with billions of potential players worldwide. Here’s how to prepare and build a Unity game for Android devices.
Setting Up the Android Development Environment
Before building for Android, developers need to configure their environment:
- Install Java Development Kit (JDK): Download and install the recommended JDK version for Unity (typically JDK 8 or later).
- Install Android Studio: While not strictly required, Android Studio provides useful tools, including the Android SDK.
- Install Android SDK: Through Android Studio or standalone, install the SDK with the appropriate API levels.
- Configure Unity: Set paths to JDK and Android SDK in Unity Preferences (Edit > Preferences > External Tools).
Configuring Unity Player Settings for Android
With the development environment ready, configure Android-specific settings in Unity:
- Open the Player Settings (Edit > Project Settings > Player)
- Navigate to the Android tab (green Android icon)
- Configure these essential settings:
- Package Name: Set a unique identifier (com.companyname.appname format)
- Version: Set the appropriate version number and code
- Minimum API Level: Balance device compatibility with feature access (Unity generally requires Android 4.4 “KitKat” / API level 19 or higher)
- Target API Level: Target the latest stable API level when possible
- Device Orientation: Select portrait, landscape, or both
- Graphics API: OpenGLES3 offers better performance, but OpenGLES2 provides wider compatibility
- Texture Compression: ETC2 for newer devices, ETC1 for wider compatibility
Android Build Process
With settings configured, follow these steps to build the APK or AAB:
- Open Build Settings (File > Build Settings)
- Select Android as the platform (switch if needed)
- Add all necessary scenes to the build
- Choose between a development and a release build
- Select build system (Gradle recommended)
- Choose between APK and AAB build format:
- APK (Android Package): Traditional format, easier for direct installation and testing
- AAB (Android App Bundle): Google Play’s preferred format creates optimized downloads for each device
Pro Tip from NKB Playtech: For testing, build APKs. For final Google Play submission, use AAB format to reduce user download sizes by up to 50%.
- Click “Build” to select output location or “Build and Run” to immediately deploy to a connected device
Android Manifest Customization
For more control over the Android build, customize the Android Manifest:
- Navigate to Plugins/Android folder in the project (create if needed)
- Create or modify AndroidManifest.xml
- Common customizations include:
- Requesting specific permissions
- Configuring screen compatibility modes
- Setting hardware requirements
Here’s a sample manifest snippet for requesting camera and internet permissions:
xml
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android“>
<uses-permission android:name=”android.permission.INTERNET“ />
<uses-permission android:name=”android.permission.CAMERA“ />
<uses-feature android:name=”android.hardware.camera“ android:required=”false“ />
<application>
<!– Activity declarations and other settings –>
</application>
</manifest>
Signing Android Builds
For Google Play distribution, developers must sign their APK or AAB:
- Create a Keystore: Generate through Android Studio or the command line
- Configure in Unity:
- In Player Settings, enable “Custom Keystore.”
- Provide the keystore file location and passwords
- Enter key alias information
Important: Store keystore files securely! Losing access to your keystore means losing the ability to update your app on Google Play.
Building for Windows: Step-by-Step
Windows remains the primary gaming platform for desktop users, offering powerful hardware and a large user base. Here’s how to build Unity games for Windows.
Windows Build Requirements
Windows builds require less setup than Android:
- Operating System: Any modern Windows (Windows 10 recommended), macOS, or Linux distribution running Unity
- Visual Studio: For C# scripting and C++ build tools (free Community edition works well)
- DirectX: Most components come pre-installed with Windows
Configuring Unity Player Settings for Windows
Optimize Windows-specific settings in Unity:
- Open Player Settings (Edit > Project Settings > Player)
- Navigate to the PC, Mac & Linux tab (blue monitor icon)
- Configure these key settings:
- Default Is Fullscreen: Enable for immersive games, disable for windowed applications
- Default Screen Width/Height: Set default resolution
- Resizable Window: Allow or prevent window resizing
- Graphics APIs: DirectX 11 offers the best performance/compatibility on modern Windows
- Auto Graphics API: Consider disabling to force specific graphics APIs
- Icon: Add custom executable icon
- Splash Screen: Customize (or remove with Pro license)
- Supported Aspect Ratios: Select all relevant display ratios
Windows Build Process
With settings configured, follow these steps to build for Windows:
- Open Build Settings (File > Build Settings)
- Select Windows as the platform (switch if needed)
- Add all necessary scenes to the build
- Choose between a development and a release build
- Select architecture (x86 for 32-bit, x86_64 for 64-bit)
- Choose between IL2CPP and Mono scripting backends:
- IL2CPP: Better performance and security, but longer build times
- Mono: Faster iteration for development builds
Pro Tip from NKB Playtech: For most commercial games, x86_64 with IL2CPP provides the best balance of performance and compatibility for modern Windows systems.
- Click “Build” to select the output folder or “Build and Run” to launch after building
Windows-Specific Optimizations
To maximize performance on Windows:
- Graphics API Selection: DirectX11 or DirectX12 for modern hardware
- Executable Compression: Enable to reduce file size (minor performance impact)
- Standalone Player Options: Configure file handling options
- Windows DPI Awareness: Enable for proper scaling on high-DPI displays
Creating Windows Installers
While Unity builds standalone executables, professional distribution often uses installers:
- Inno Setup: Free, open-source installer creator
- InstallShield: Professional but costly solution
- NSIS (Nullsoft Scriptable Install System): Powerful open-source option
Using installers provides benefits like:
- Registry integration
- Start menu shortcuts
- Uninstall functionality
- Prerequisites installation (DirectX, .NET, etc.)
Cross-Platform Considerations
When targeting both Android and Windows, certain considerations help maintain a consistent experience while leveraging platform strengths.
Input System Management
Different platforms use different input methods:
- Android: Touch-based with possible gamepad support
- Windows: Mouse/keyboard with gamepad support
Unity’s new Input System package helps manage these differences:
- Install via Package Manager
- Create input action assets for different control schemes
- Use a control scheme switching based on the detected platform
UI Scaling and Adaptation
User interfaces must adapt to different screen sizes and aspect ratios:
- Use Unity’s Canvas Scaler component with appropriate scaling modes:
- Screen Space – Overlay for UI elements
- Screen Space – Camera for 3D-integrated UI
- World Space for diegetic interfaces
- Test on multiple resolutions and aspect ratios
- Consider separate UI layouts for drastically different platforms
NKB Playtech recommends: Start with mobile-first UI design, then adapt for larger screens by adding more information rather than just scaling up elements.
Performance Profiling Per Platform
Each platform has different performance considerations:
- Android: CPU/GPU/battery limitations, thermal throttling
- Windows: Varied hardware capabilities, background processes
Unity’s profiler helps identify platform-specific bottlenecks:
- Use development builds with profiler support
- Test on actual target devices (not just the editor)
- Create performance profiles for different hardware tiers
Build Optimization Techniques
Optimizing builds ensures better performance and smaller file sizes across platforms.
Asset Optimization
Reduce build size with proper asset management:
- Texture Compression:
- Android: ETC2 for modern devices
- Windows: DXT compression for best compatibility
- Use appropriate texture sizes (avoid oversized textures)
- Audio Compression:
- Vorbis for background music
- PCM or ADPCM for sound effects
- Use appropriate sample rates (44.1 kHz not always needed)
- Model Optimization:
- Reduce polygon counts for mobile
- LOD (Level of Detail) systems for scaling complexity
- Optimize colliders (use primitive colliders when possible)
Code and Project Optimization
Streamline the codebase and project structure:
- Script Stripping: Enable bytecode stripping to remove unused code
- Assembly Definition Files: Organize code into logical assemblies
- Addressable Assets: Use for better memory management in larger games
- Unused Reference Removal: Regularly delete unused assets and references
Platform-Specific Build Settings
Fine-tune builds for each platform:
- Android:
- Split Application Binary (APK) for appropriate CPU architectures (ARM64, ARMv7)
- Configure texture compression per device capability
- Optimize for specific Android versions
- Windows:
- Consider separate builds for different hardware capabilities
- Balance between graphics quality and performance
- Test with various graphics APIs (DirectX11, DirectX12)
Testing Your Builds
Thorough testing prevents issues after release.
Testing Android Builds
Follow these steps to effectively test Android builds:
- Device Diversity: Test on multiple device types (phone/tablet) and screen sizes
- OS Versions: Test on several Android versions (especially the minimum supported version)
- Installation Testing:
- Direct APK installation (via USB)
- Google Play internal testing tracks
- Testing on clean devices (first installation)
- Update testing from previous versions
- Performance Testing:
- Monitor framerate stability
- Check loading times
- Test battery consumption
- Verify thermal performance (extended play sessions)
Testing Windows Builds
For Windows builds, focus on these testing areas:
- Hardware Configurations:
- Different CPU/GPU combinations
- Various RAM configurations
- HDD vs SSD storage
- Multiple monitors and resolutions
- Software Environments:
- Windows versions (10, 11)
- With/without the latest updates
- Various background application loads
- Different graphics driver versions
- Installation Scenarios:
- Clean install
- Update from the previous version
- Installation in non-standard locations
Automated Testing Options
Scale testing with automation:
- Unity Test Framework: Create playmode and editmode tests
- Device Farms: Services like AWS Device Farm or Firebase Test Lab
- Build Servers: Jenkins or Unity Cloud Build for continuous integration
- Analytics Integration: Track performance metrics from beta testers
Distribution Platforms
With optimized builds ready, the final step is distribution.
Android Distribution
Google Play Store is the primary Android distribution channel:
- Developer Account: Register for a Google Play Developer account ($25 one-time fee)
- Store Listing: Create a compelling store page with screenshots, videos, and descriptions
- Release Tracks:
- Internal testing: Limited to project members
- Closed testing: Specific test groups with email addresses
- Open testing: Public beta testing
- Production: Full public release
- Alternative Stores:
- Amazon Appstore
- Samsung Galaxy Store
- Huawei AppGallery
- Direct APK distribution (sideloading)
Windows Distribution
Multiple distribution options exist for Windows games:
- Steam:
- Market leader for game distribution
- $100 submission fee
- Powerful features (achievements, cloud saves)
- Built-in community features
- Epic Games Store:
- Growing alternative to Steam
- Selective curation process
- More favorable revenue split
- Microsoft Store:
- Native Windows integration
- $19 developer registration fee
- Xbox ecosystem integration
- Itch.io:
- Indie-friendly platform
- Flexible payment model
- Easy setup process
- Direct Distribution:
- Personal website downloads
- Custom launcher development
- Full control over distribution
Monetization Considerations
Different platforms offer various monetization options:
- Mobile/Android:
- In-app purchases (Google Play Billing)
- Advertisements (AdMob, Unity Ads)
- Premium (paid app)
- Subscriptions
- Windows/Desktop:
- Upfront purchase
- DLC (downloadable content)
- In-game store
- Subscription services
NKB Playtech insight: Cross-platform games should consider a unified virtual currency that works across platforms while respecting each store’s payment systems.
Post-Release Management
The work doesn’t end after release. Effective post-release management keeps games relevant and profitable.
Update Strategy
Plan for regular updates to maintain engagement:
- Hotfixes: Rapid response to critical issues
- Content Updates: New features and content on a regular schedule
- Seasonal Events: Time-limited content tied to holidays or seasons
- Major Expansions: Substantial new features or content
Analytics Implementation
Use data to guide development decisions:
- Key Metrics:
- DAU/MAU (Daily/Monthly Active Users)
- Retention rates
- Session length
- Conversion rates
- Platform-specific performance
- Analytics Tools:
- Unity Analytics
- Firebase Analytics
- GameAnalytics
- Custom solutions
Community Management
Build and maintain a player community:
- Communication Channels:
- Discord server
- Social media accounts
- Forums or subreddit
- Email newsletters
- Feedback Loops:
- Feature request systems
- Bug reporting mechanisms
- Public roadmaps
- Beta programs for upcoming features
Conclusion: Your Game in Players’ Hands
Building and exporting a Unity game for Android or Windows represents the culmination of the development process. By following the steps outlined in this guide from NKB Playtech, developers can ensure their games reach their audience in the best possible state.
Remember that the build process is not just a technical requirement but an opportunity to optimize the player experience. Each decision made during the build and export process affects how players will perceive the final product.
The experts at NKB Playtech recommend treating the build process as an integral part of game development rather than an afterthought. Plan for it from the beginning, test thoroughly, and continuously refine the process to create games that not only function correctly but delight players across all target platforms.
Now, armed with this knowledge, developers can confidently transform their Unity projects into polished games ready for millions of players on Android devices and Windows computers worldwide.