[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Export Godot projects to Android\n\nThis topic describes how to export a Godot project as an Android app. Godot can\ngenerate both APK files for local device testing and Android App Bundles for\nsubmission to the Google Play Store.\n\nInstall an Android build template\n---------------------------------\n\nGodot uses a build template as a starting point to generate Gradle files and\nother data necessary to create and build an Android app. A build template must\nbe imported into a Godot project prior to exporting an Android build. Each\nversion of Godot has its own template. To install an Android build template into\na project, perform the following steps:\n\n1. Open the project in the Godot editor.\n2. In the menu bar, select **Project -\\\u003e Install Android Build Template...**\n3. Click the **Manage Templates...** button.\n4. In the **Export Template Manager** window, click the **Download** button for the Godot version being used (Current Version).\n5. Select a mirror location to download the file.\n6. After the download completes, click the **Close** button in the **Export Template Manager** window.\n7. From the editor menubar, select **Project -\\\u003e Install Android Build Template...**\n8. A confirmation dialog will appear. Click the **Install** button.\n\n**Figure 1.** The **Export Template Manager** window\n\nThe build template files will be stored in an `android/build` subdirectory that\nis relative to the project root directory. Due to the size of this subdirectory,\nyou may wish to omit it from the version control scope of your project.\n\nAdd an Android export preset\n----------------------------\n\nAn export preset for Android must be created for the project. To create a\npreset, perform the following steps:\n\n1. From the editor menu bar, select **Project -\\\u003e Export...**\n2. From the **Export** window, select the **Add...** dropdown menu, and then select the **Android** option as follows:\n\n**Figure 2:** The **Export** window\n\nCustomize Android export options\n--------------------------------\n\nAfter creating an Android export preset for your project, you can configure\nexport options by selecting the new preset in the **Export** window. Export\noptions are grouped into categories to the right of the **Export** window.\nCommon options to adjust include:\n\n### Export Format and Use Custom Build\n\nThe **Export Format** option indicates whether to export as an APK file or an\nAndroid App Bundle (.AAB). For testing on a local device during development, an\nAPK file is more convenient, as it can be directly installed using `adb`. For\nbuilds that you intend to upload to Google Play, use an Android App Bundle.\n\nThe **Use Custom Build** option controls whether Godot uses its own internal\nbuild process, or a traditional Gradle build process. If **Use Custom Build** is\nchecked, Godot will perform a Gradle build. **Use Custom Build** must be checked\nif any of the follow conditions apply:\n\n- The **Export Format** is set to Android App Bundle\n- The project is using the Godot Android plugin system\n\n**Figure 3:** The **Export Format** and **Custom Build** options\n\n### Architectures\n\nThe **Architectures** section specifies the CPU architectures to include in the\nbuild. Exporting a build with multiple architectures will increase the size of\nthe exported APK or AAB file, which increases the iteration time when exporting\nand deploying to a device. During development you can reduce the iteration time\nby only selecting the architecture of the test device. When submitting to Google\nPlay, you should export with all available architectures supported by your\nproject.\n| **Note:** Google Play requires 64-bit architectures in submitted App Bundles. If you select the **Armeabi-v7a** architecture you must also select **Arm64-v8a** . Correspondingly, if you select **X86** , you must also select **X86 64**.\n**Figure 4:** The export **Architectures** options\n\n### Keystore\n\nThe **Keystore** section is where debug and release keystore files are\nconfigured. These are used when digitally signing the exported app. The\n**Debug** and **Release** fields should be paths to the respective keystore\nfiles. The **Debug User** and **Release User** fields should be set to the alias\nnames in the keystore.\n**Figure 5:** The export **Keystore** options\n\nIf a debug keystore file has been configured in the global **Editor Settings -\\\u003e\nExport -\\\u003e Android** section, the **Debug** keystore fields in the project Export\noptions may be left blank, and the global debug keystore file will be used as\ndefault.\n\nTo create a build for upload to the Google Play Store, you can use Android\nStudio to create a release keystore file.\n\nTo create a release keystore file for your app:\n\n1. Launch Android Studio.\n2. In the **Welcome to Android Studio** window, select **Create New Project**.\n3. Select the **No Activity** template, and click **Next**.\n4. In the **Configure Your Project** screen, click **Finish** to create the project.\n5. Create a keystore file using the instructions at [Generate an upload key and keystore](/studio/publish/app-signing#generate-key).\n6. After creating the keystore file, quit Android Studio and return to the Godot editor.\n7. Add the keystore file to the **Release** field and enter the **Release User** and **Release Password** values into their respective fields.\n\n| **Note:** The `export_presets.cfg` file in your project directory contains your keystore credentials. To keep your credentials secure, do not distribute this file or commit it to a public version control repository.\n\n### Version and Package\n\nThe **Version** and **Package** sections specify the version code, version\nstring, package identifier, and package name for your app. The **Unique Name**\nfield should be set to the package identifier used by your app in Google Play\nConsole.\n**Figure 6:** The export **Version** and **Package** options\n\n### Launcher icons\n\nThe launcher icons section specifies the .png files to use as icons for your\napp. If icons files are not specified, Godot will use a default icon file. Godot\nsupports specifying both legacy application icons, and the adaptive icons\navailable in Android 8 and later. For tips on creating adaptive icons, see the\n[adaptive icons](/guide/practices/ui_guidelines/icon_design_adaptive) guide.\n**Figure 7:** The export **Launcher Icons** options\n\nExport a build\n--------------\n\nTo export a build, follow these steps:\n\n1. Select **Project -\\\u003e Export...** from the Godot menu bar.\n2. Select an Android export preset from the preset list.\n3. Click the **Export Project** button at the bottom of the **Export** window.\n4. In the **Save a File** dialog box, choose a name for the exported file.\n5. Uncheck the **Export With Debug** checkbox to create a Release build.\n6. Click **Save** to export the build.\n\n**Figure 7:** The export **Save a File** dialog\n\nThe export progress window will look different if the **Use Custom Build**\noption is checked in the export preset. Custom builds display the output of the\nGradle build process."]]