Basic Usage
android- Build for Androidios- Build for iOS
Options
Build Configuration
| Option | Description | Default |
|---|---|---|
--release | Build in release mode (optimized) | Yes |
--debug | Build in debug mode (with symbols) | No |
Backend Selection
| Option | Description | Default |
|---|---|---|
--rust | Use Rust backend only | Yes |
--cemu | Use CEmu backend only | No |
--both | Include both backends (runtime switching) | No |
Platform-Specific Options
Android:| Option | Description | Default |
|---|---|---|
--install | Install APK after build | No |
--all-abis | Build for all ABIs (arm64, arm32, x86_64, x86) | No (arm64 only) |
| Option | Description | Default |
|---|---|---|
--sim | Build for iOS Simulator | No (device) |
--open | Open Xcode after building backend | No |
Other Options
| Option | Description |
|---|---|
--help | Show help message |
Android Examples
Basic Builds
Backend Selection
Output Location
Built APKs are placed in:iOS Examples
Basic Builds
Backend Selection
iOS Build Process
The build script only compiles the backend library (Rust and/or CEmu). After running the script:-
Open the Xcode project:
-
Select the appropriate scheme:
- Calc-Rust - Rust backend only
- Calc-CEmu - CEmu backend only
- Calc-Both - Both backends with runtime switching
-
Press
Cmd+Rto build and run the app
Output Location
Backend libraries are placed in:Make Targets (Shortcuts)
For convenience, the project includes Make targets as shortcuts for common build commands.Android Make Targets
iOS Make Targets
Utility Make Targets
Build Process Details
Android Build Steps
-
Rust Core Compilation (if
--rust)- Detects Android NDK location
- Adds NDK toolchain to PATH
- Builds Rust core for target ABIs
- Output:
core/target/<abi>/release/libemu_core.a
-
Gradle Build
- Cleans CMake cache if backend changed
- Passes backend flags to Gradle
- Compiles native code (JNI bridge + backend)
- Assembles APK
-
Installation (if
--install)- Uninstalls existing app
- Installs new APK via
adb
iOS Build Steps
-
Rust Core Compilation (if
--rust)- Determines target architecture (device or simulator)
- Builds with
ios_prefixedfeature (exportsrust_*symbols) - Copies to
libemu_rust.a
-
CEmu Adapter Compilation (if
--cemu)- Generates CMakeLists.txt for CEmu sources
- Builds with CMake/Xcode for iOS target
- Copies to
libemu_cemu.a
-
Xcode Integration
- Backend libraries are statically linked by Xcode
backend_bridge.cprovides unified API and runtime switching
Troubleshooting
Android NDK Not Found
CEmu Not Found
Rust Target Not Installed
If you see “error: toolchain ‘stable-…’ does not have target ’…’”:Next Steps
- Platform-Specific Builds - Manual build instructions using Gradle/Xcode directly
- Testing - Run tests and verify your build