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
| Property | Default | Purpose |
|---|---|---|
TwoDogVariant | Follows the configuration | Native engine variant: debug or release |
TwoDogAndroidGameAssembly | Set by the generated host | Game assembly that Godot loads; kept whole by the trimmer |
TwoDogAndroidExportPreset | Android | Preset in export_presets.cfg |
TwoDogAndroidPack | Exported by the build | Use an existing game pack instead of exporting one |
TwoDogAndroidGdExtensions | true | Package the Android libraries of the project's GDExtensions |
TwoDogAndroidSigning | true | Sign using .NET signing properties, Godot's keystore variables, or the debug keystore |
AndroidPackageFormats | apk in the generated host | apk 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:
- The .NET
AndroidKeyStoreandAndroidSigning*properties - Godot's
GODOT_ANDROID_KEYSTORE_RELEASE_PATH,_USER, and_PASSWORDenvironment variables (theDEBUGvariables for Debug builds). Set all three variables together. - Android's debug keystore,
~/.android/debug.keystore - 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:
<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:
dotnet publish MyGame.android -c Release -p:PublishAot=true -p:AndroidNdkDirectory=$ANDROID_HOME/ndk/29.0.14206865Without PublishAot, Release builds use Mono's AOT compiler through RunAOTCompilation.