Android
Manual Gradle Build
You can build the Android app directly using Gradle without the build script.Build Commands
Backend Selection
Control which backend to build using Gradle properties:ABI Selection
By default, only ARM64 is built. To build all ABIs:Android Studio
Opening the Project- Open Android Studio
- Select File → Open
- Navigate to the
android/directory - Click Open
- Select Build → Make Project (or press
Cmd+F9) - The app will compile with default settings (Rust backend, ARM64)
- Select Run → Run ‘app’ (or press
Ctrl+R) - Choose a device or emulator
- The app will install and launch
android/gradle.properties:
Native Library Locations
Compiled native libraries are placed in:Development Workflow
For rapid iteration with auto-deploy:iOS
Building with Xcode
The iOS app must be built with Xcode after compiling the backend library.Step 1: Build Backend Library
First, compile the Rust and/or CEmu backend:Step 2: Open Xcode
Step 3: Select Scheme
Xcode includes three schemes depending on which backend you built:- Calc-Rust - Rust backend only (requires
libemu_rust.a) - Calc-CEmu - CEmu backend only (requires
libemu_cemu.a) - Calc-Both - Both backends with runtime switching
Step 4: Build and Run
PressCmd+R to build and run the app.
Manual Backend Compilation
Rust Backend
ios_prefixed feature exports symbols with rust_ prefix (e.g., rust_emu_create) for dual-backend builds.
CEmu Backend
The CEmu backend is built using CMake and compiled as a static library:-DCMAKE_OSX_SYSROOT=iphonesimulator.
Xcode Build Settings
Key settings in the Xcode project: Library Search Paths (per scheme):- Calc-Rust:
libemu_rust.a - Calc-CEmu:
libemu_cemu.a - Calc-Both:
libemu_rust.a+libemu_cemu.a
Web
Manual Build Steps
The web app uses Vite and requires building the WASM package first.Step 1: Build WASM Package
core/pkg/:
Step 2: Copy to Web App
Step 3: Install Dependencies
Step 4: Build or Run
Development Server
For development with hot reload:http://localhost:5173.
CEmu Web Backend
To build with CEmu WASM backend (requires Emscripten):- Builds CEmu core with Emscripten
- Generates
WebCEmu.jsandWebCEmu.wasm - Copies files to
web/src/cemu-core/
Production Build
web/dist/. Serve with:
WASM Package Size
The optimized WASM package is approximately:- Rust WASM: ~96KB gzipped
- CEmu WASM: ~180KB gzipped
Make Targets Summary
Quick reference for all platform builds:Troubleshooting
Gradle Build Fails
CMake error or stale native build:Xcode Build Fails
Library not found: Ensure you built the backend library first:- Apple Silicon Mac → use
--simwithaarch64-apple-ios-sim - Intel Mac → use
--simwithx86_64-apple-ios - Physical device → use device target with
aarch64-apple-ios
WASM Build Fails
wasm-pack not found:CEmu Build Fails
cemu-ref not found:Next Steps
- Testing - Run tests to verify your build
- Development Workflow - Set up your development environment
- Debugging - Debug the emulator core