Exporting Godot Games to Mobile
Mobile export from Godot is straightforward once the platform SDKs are configured, but the setup process differs significantly between Android and iOS. Android requires the Android SDK and a debug keystore, which can be installed on any operating system. iOS requires a Mac with Xcode installed, since Apple's toolchain is the only way to compile and sign iOS applications. Both platforms share the same Godot project and GDScript codebase, with platform-specific adjustments handled through the export settings and conditional code.
Set Up the Android SDK
Android export requires the Android SDK command-line tools, a Java Development Kit (JDK), and a debug keystore for signing builds. Install the Android SDK through Android Studio's SDK Manager or by downloading the standalone command-line tools from the Android developer website. You need at minimum the Android SDK Platform-Tools, the Android SDK Build-Tools, and an Android platform package matching your target API level (API 33 or later is recommended for current devices).
In Godot, go to Editor Settings, Export, Android, and set the paths to your Android SDK, JDK, and debug keystore. If you do not have a debug keystore, generate one using the keytool command that ships with the JDK: 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. Point Godot to this keystore file in the editor settings.
Install the Android build template through the Project menu: click "Install Android Build Template." This copies the Gradle build files into your project's android/ directory, which Godot uses to compile the APK or AAB. Without the build template, Godot uses a pre-built generic template that does not support custom Gradle dependencies, Android plugins, or advanced manifest configurations.
Configure Android Export Settings
Add an Android export preset in the Export dialog. The key settings include the package unique name (reverse domain format like com.yourstudio.yourgame), the minimum SDK version (API 24 is a reasonable floor that covers 95 percent of active devices), the target SDK version (should match the latest Android requirements for store submission), and the screen orientation (landscape for most games, portrait for vertical games, or sensor for automatic rotation).
Choose between APK and AAB output formats. APK files are standalone installer packages that you can sideload directly onto devices, making them ideal for testing and direct distribution. AAB (Android App Bundle) files are required for Google Play Store submission and let Google optimize the download for each device, resulting in smaller installs. For development and testing, use APK. For store release, use AAB.
Configure permissions based on what your game needs. If your game accesses the internet (for LLM dialogue, ads, or analytics), enable the INTERNET permission. If it vibrates the device for haptic feedback, enable VIBRATE. Do not enable permissions your game does not need, since unnecessary permissions can reduce store listing appeal and trigger extra review during submission. The export preset lists all available permissions with descriptions.
The "Gradle Build" section lets you add custom Gradle dependencies, which is how you integrate Android-specific plugins like AdMob for advertising, Firebase for analytics, or Google Play Services for achievements and leaderboards. Add the dependency strings in the export settings, and Godot includes them in the Gradle build configuration automatically.
Set Up iOS Export
iOS export requires a Mac running macOS with Xcode installed. There is no way to compile iOS applications on Windows or Linux due to Apple's licensing restrictions on their compilation toolchain. Install the latest version of Xcode from the Mac App Store, then open it once to accept the license agreement and install the command-line tools.
You need an Apple Developer account (which costs 99 USD per year) to run apps on physical iOS devices and to submit to the App Store. Free Apple IDs can build apps for the simulator but cannot deploy to hardware. In Xcode, sign in with your Apple ID under Preferences, Accounts, and set up a development team.
In Godot's Export dialog, add an iOS preset. Set the Bundle Identifier (same reverse domain format as Android), the team ID from your Apple Developer account, and the deployment target iOS version. Godot exports an Xcode project folder containing the compiled game binary, resource files, and project configuration. Open this folder in Xcode to build, sign, test on a connected iPhone or iPad, and submit to the App Store through Xcode's archive and upload process.
Unlike Android where Godot directly produces an installable file, the iOS workflow requires Xcode as an intermediary. Any changes to the game require re-exporting from Godot and reopening the project in Xcode. This makes the iOS iteration cycle slower than Android, where you can deploy directly from the Godot editor to a connected device.
Implement Touch Controls
Mobile games need touch input since there is no keyboard or mouse. Godot provides several approaches to touch controls. The simplest is enabling "Emulate Mouse From Touch" in Project Settings (Input Devices, Pointing), which converts touch events to mouse events so your existing mouse-based input code works on mobile without changes. This works for tap-to-interact games but is insufficient for games requiring joystick-style movement.
For games that need a virtual joystick, create a TouchScreenButton node or build a custom joystick using a Control node that processes touch drag events. The custom approach gives you more control over appearance and behavior. Track the touch position relative to the joystick center, normalize the offset to a unit circle, and use the resulting vector as your movement input. Implement dead zones (ignore input below a small threshold) to prevent drift when the player's thumb rests on the joystick without intentional movement.
Multi-touch gestures are handled through InputEventScreenTouch and InputEventScreenDrag events. Each touch has a unique index that persists from touch-down to touch-up, letting you track multiple fingers independently. Pinch-to-zoom uses two touch points: track the distance between them on each frame, and scale the camera or zoom level based on the distance change. Swipe detection measures the velocity and direction of a touch drag when the finger lifts.
Design touch controls with mobile ergonomics in mind. Buttons need to be large enough to tap reliably (at least 44x44 points), interactive elements should not be placed near screen edges where they conflict with system gestures, and frequently used controls should be within comfortable thumb reach. Test on actual phones and tablets, not just the desktop simulator, since the feel of touch controls can only be evaluated on real hardware.
Optimize for Mobile Hardware
Mobile GPUs handle significantly fewer draw calls per frame than desktop GPUs. Every material change, texture swap, and separate mesh is a potential draw call. For 2D games, Godot's batch renderer groups similar draw calls automatically, but you should still minimize the number of unique materials and texture atlases. For 3D games, merge static meshes where possible, use LOD (Level of Detail) to reduce polygon counts for distant objects, and minimize shader complexity.
Texture memory is limited on mobile devices. Use compressed texture formats (ETC2 for Android, ASTC for iOS) which Godot configures automatically in the export settings. Reduce texture resolution for mobile exports if the same assets are used on desktop at higher resolution. A 2048x2048 texture that looks great on a desktop monitor is overkill on a 6-inch phone screen where it will be displayed at a fraction of its native resolution.
CPU optimization matters for AI-heavy games on mobile. Behavior tree evaluations, pathfinding queries, and physics calculations all consume CPU time that is more limited on mobile processors than desktop processors. Reduce AI update frequencies, stagger pathfinding across frames, and simplify behavior trees for mobile builds. Consider using conditional compilation or feature flags to run simpler AI on mobile while keeping full complexity on desktop.
Battery consumption is a hidden performance metric on mobile. Games that max out the GPU and CPU drain batteries quickly, which players notice and dislike. Cap your frame rate to 30 or 60 FPS (matching the device refresh rate) instead of running unlimited. Reduce processing during idle moments when the game is paused or in menus. Use Godot's low-processor mode setting for screens that do not need real-time updates.
Test on Physical Devices
Godot 4.6 introduced Android device mirroring directly in the editor. Connect an Android device via USB with developer mode and USB debugging enabled, and the editor displays a one-click deploy button that builds and installs the game on the connected device. The device's screen can be mirrored in the editor for observation. This dramatically speeds up the mobile testing cycle compared to manually exporting and sideloading APK files.
Test on a range of devices representing different performance tiers. A flagship phone from the current year and a mid-range phone from two to three years ago give you a good spread. Performance that feels smooth on a high-end device may stutter on budget hardware, and touch controls that work on a large tablet may be cramped on a small phone. If you do not have multiple physical devices, Android emulators with different hardware profiles provide approximate testing, though they do not perfectly replicate real device performance or touch feel.
For iOS testing, you must use Xcode to deploy to connected iPhones and iPads. The Xcode Simulator runs on your Mac's hardware and does not accurately represent mobile performance, so testing on physical devices is essential for performance validation. Connect an iPhone, select it as the build target in Xcode, and click Run. The game compiles and launches on the device with console output visible in Xcode's debugger.
Godot's mobile export targets Android directly from the editor and iOS through Xcode, with the same codebase serving both platforms. Success on mobile requires touch-native controls, aggressive performance optimization for limited hardware, and testing on real devices across different screen sizes and hardware tiers.