Skip to content

Android Configuration ​

Set properties in MyGame.android.csproj. The generated host references 2dog.engine, 2dog.android, and the native meta package for its selected android-arm64 or android-x64 RID. See global settings for the game directory and import controls.

Properties ​

PropertyDefaultPurpose
TwoDogVariantFollows the configurationNative engine variant: debug or release
TwoDogAndroidGameAssemblySet by the generated hostGame assembly that Godot loads; kept whole by the trimmer
TwoDogAndroidExportPresetAndroidPreset in export_presets.cfg
TwoDogAndroidPackExported by the buildUse an existing game pack instead of exporting one
TwoDogAndroidGdExtensionstruePackage the Android libraries of the project's GDExtensions
TwoDogAndroidSigningtrueSign using .NET signing properties, Godot's keystore variables, or the debug keystore
AndroidPackageFormatsapk in the generated hostapk for sideloading, aab for app stores

Android exports its pack during the build and puts it inside the APK/AAB; TwoDogExportPack does not apply. See the Android host guide for SDK setup and installation.

Signing ​

When you publish, the build signs the app with the first keystore that it finds:

  1. The .NET AndroidKeyStore and AndroidSigning* properties
  2. Godot's GODOT_ANDROID_KEYSTORE_RELEASE_PATH, _USER, and _PASSWORDenvironment variables (the DEBUG variables for Debug builds). Set all three variables together.
  3. Android's debug keystore, ~/.android/debug.keystore
  4. The .NET debug keystore

Trimming and Mono AOT ​

Release builds use .NET for Android's default trimming and AOT; see its build properties. 2dog preserves GodotSharp, GodotPlugins, twodog, and the game assembly. If your code uses another assembly only through reflection, add it as a trimmer root:

xml
<ItemGroup>
  <TrimmerRootAssembly Include="MyLibrary" RootMode="All"/>
</ItemGroup>

Native AOT ​

.NET for Android's Native AOT is experimental. It supports 2dog's debug and release variants and needs the Android NDK:

bash
dotnet publish MyGame.android -c Release -p:PublishAot=true -p:AndroidNdkDirectory=$ANDROID_HOME/ndk/29.0.14206865

Without PublishAot, Release builds use Mono's AOT compiler through RunAOTCompilation.

2dog is Free and Libre Open Source under the MIT License.
2dog is not affiliated with or endorsed by the Godot Foundation.
Godot is licensed under the MIT License; the Godot logo is by Andrea Calabró under CC BY 4.0. @icons made by Voxy under the MIT License.
Continuous Integration compute graciously supported by Blacksmith.