How to Build ArmorPaint for Android and iOS: Complete Cross-Platform Guide
To build ArmorPaint for Android and iOS, run ../base/make --target android or ../base/make --target ios from the paint/ directory to generate native Gradle or Xcode projects, then open them in Android Studio or Xcode to compile the native binaries.
The armory3d/armorpaint repository uses a custom JavaScript-based build pipeline rather than standard build systems like CMake or Make for mobile targets. Understanding how to build ArmorPaint for Android and iOS requires navigating the base/tools/make.js script, which generates platform-specific native projects from shared C/C++ sources and platform-specific bridges.
Understanding the ArmorPaint Build Architecture
The build process centers on Node.js scripts that act as a meta-build system. The file base/tools/make.js orchestrates project generation by parsing command-line flags, selecting appropriate templates, and substituting configuration values.
When targeting mobile platforms, the script executes a specific pipeline:
- Template Processing: Copies Gradle configurations for Android or Xcode project stubs for iOS from
base/tools/intobuild/ArmorPaint/ - Source Aggregation: Appends platform-specific C sources—
sources/backends/android_*.cfor Android orsources/backends/ios_*.cfor iOS—via configurations inbase/project.js - Placeholder Substitution: Injects package names, SDK versions, and permissions into
AndroidManifest.xmlor Xcode project settings
Prerequisites for Mobile Compilation
Before generating projects, install the required native toolchains:
- Android: Android Studio with Android SDK and NDK (includes
aarch64-none-linux-android21toolchain) - iOS: Xcode with iOS SDK and command-line tools (supports
arm64architecture)
Clone the repository and navigate to the paint subdirectory:
git clone https://github.com/armory3d/armorpaint
cd armorpaint/paint
Building ArmorPaint for Android
Generate the Android Project
Execute the make script with the Android target flag:
../base/make --target android
This command triggers several operations defined in base/tools/make.js:
- Creates the output directory structure at
build/ArmorPaint/ - Copies template files including
base/tools/android/build.gradle.ktsandbase/tools/android/AndroidManifest.xml - Invokes
write_app_gradleto inject default values: package nameorg.armory3d,compileSdkVersion 36,minSdkVersion 35, andtargetSdkVersion 36 - Executes
write_cmake_liststo produce aCMakeLists.txtreferencing all C/C++ sources and include directories - Processes
icon_ios.pnginto appropriately sized resources inmipmap-*/folders
Compile in Android Studio
Open the generated project:
open build/ArmorPaint/ArmorPaint
In Android Studio, sync the Gradle files, select a connected device or emulator, and click Run. The NDK compiles the native code alongside the Java/Kotlin bridge files located in base/sources/backends/data/android_java/, including IronActivity.kt, producing the final APK.
Building ArmorPaint for iOS
Generate the iOS Project
From the paint/ directory, run:
../base/make --target ios
The script generates build/ArmorPaint/ArmorPaint.xcodeproj by:
- Aggregating iOS-specific sources defined in
base/project.js, includingsources/backends/ios_system.hand Objective-C bridge files frombase/sources/backends/data/ios/ - Copying and configuring Xcode project templates with default architectures set to
arm64 - Embedding icons and resources into the generated asset catalog
Compile in Xcode
Launch the project:
open build/ArmorPaint/ArmorPaint.xcodeproj
Select a physical iOS device or simulator scheme, then press Run. Xcode compiles the Objective-C/Swift bridges with the C core, handling code signing and entitlements automatically.
Customizing Mobile Build Parameters
Override default settings without modifying source templates using the --set flag, or edit base/project.js directly to persist changes.
Generate an Android build with a custom package name and ABI filter:
../base/make --target android \
--set "android.package=com.example.custompaint" \
--set "android.abiFilters=arm64-v8a"
Specify version and build numbers for iOS:
../base/make --target ios \
--set "ios.version=2.0" \
--set "ios.build=42"
Alternatively, modify the project.target_options.android or project.target_options.ios objects in base/project.js to change default permissions, SDK levels, or bundle identifiers across all future builds.
Summary
- ArmorPaint uses
base/tools/make.jsas its meta-build system to generate native mobile projects from shared C/C++ sources. - The
--target androidflag produces Gradle projects inbuild/ArmorPaint/using templates frombase/tools/android/, includingbuild.gradle.ktsandAndroidManifest.xml. - The
--target iosflag generates Xcode projects with Objective-C bridges frombase/sources/backends/data/ios/and configurations frombase/project.js. - Final compilation requires opening generated projects in Android Studio or Xcode to leverage platform-specific SDKs, NDK toolchains, and code signing capabilities.
- Build parameters such as package names, versions, and ABI filters can be customized via command-line
--setflags or by editing theproject.target_optionsobjects inbase/project.js.
Frequently Asked Questions
What build system does ArmorPaint use for mobile platforms?
ArmorPaint uses a custom Node.js-based build system defined in base/tools/make.js and configured in base/project.js. Rather than using CMake or Make directly for mobile binaries, this system generates native projects—Gradle builds for Android and Xcode projects for iOS—that are then compiled by the platform's native IDE.
Where are the generated Android and iOS project files located?
After running the make command with --target android, project files appear in build/ArmorPaint/ including build.gradle.kts, settings.gradle.kts, and AndroidManifest.xml templates. For iOS builds using --target ios, the system creates build/ArmorPaint/ArmorPaint.xcodeproj along with associated Objective-C source references and asset catalogs.
How do I change the package name or version for mobile builds?
Pass custom values via the --set flag when invoking make, such as --set "android.package=org.custom.app" for Android or --set "ios.version=1.5" for iOS. You can also permanently adjust these values in the project.target_options object within base/project.js to apply defaults across all builds.
Can I build ArmorPaint for mobile without Android Studio or Xcode?
No. While base/tools/make.js generates the project files and CMake configurations, the actual compilation and packaging requires the native toolchains. Android builds need Android Studio with the NDK to handle APK packaging and signing, while iOS builds require Xcode with the iOS SDK for code signing, entitlements, and device deployment.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →