Flax is compiled for Linux platform using Android NDK and build with Android SDK. Supported are system version Android 7 or newer (platform API level 24). Flax uses Vulkan for rendering graphics on Android (min. Vulkan 1.0).
Follow these steps to setup your development PC for building game for Android platform. In case of problems, please follow official documentation of Android platform.
- Install Open JDK (https://jdk.java.net/15 and set
JAVA_HOMEto jdk root folder)
- Download and install Android Studio (https://developer.android.com/studio)
- Open Android Studio and complete the setup (install it to the default location or custom one and set
ANDROID_SDKto SDK root folder)
- Install NDK (via Android SDK side-by-side or manually via https://developer.android.com/ndk/downloads/index.html and set
ANDROID_NDKto install location)
- (when using Flax from Launcher) Install Android Platform Tools for Editor installation via Flax Launcher
See Game Cooker window.
|Output||The builded game output folder (relative to the project).|
|Show Output||If checked, after building the output folder will be shown in an Explorer.|
|Configuration Mode||Game building mode. Possible options:
See Android Platform Settings asset.
|Package Name||The application package name (eg.
|Permissions||The application permissions list (eg.
|Override Icon||Custom icon texture to use for the application (overrides the default one).|
C++ Android development toolsvia Visual Studio Installer
- Build game for android to
.apkand install it on the device
- Regenerate scripts projects files
- Set startup project to one named
- Edit that project properties:
Debugging -> Package To Launchset your apk path in
Package to Launchand set
Additional Symbol Search Pathsto game cooker output location folder with
libFlaxGame.sofile for the target arch ARM64 (
- Run the Android project with a debugger on an device
Optionally you can install apk manually and attach to it with
Debug -> Attach to Android Process
- Once debugger is attached you can insert breakpoints and debug the game code
Android adb logs collecting
Debug and Devlopment builds are using low-level Android logger to output engine and game logs directly to the
.\adb.exe -d logcat Flax:I *:S to listen for game logs on device.
- Build Debug build
libVkLayer_khronos_validation.so(optionally other validation libs) from
NDK/sources/third_party/vulkan/src/build-android/jniLibs/arm64-v8ato output Gradle project libs folder (
- Monitor adb output log with Vulkan Validation layer logs
- Note that game performance will be lower (esp. CPU) due to additional validation of the GPU commands
- Flax exposes Gamepad for Android device at index 0 which can be used to vibrate the device or read the Back key pressed by the user during gameplay
- To enable device vibrations add
android.permission.VIBRATEto the permissions list in Android Platform Settings asset
- To enable device network state reading add
android.permission.ACCESS_NETWORK_STATEto the permissions list in Android Platform Settings asset