XU XUv0.13.1
中文

Build mobile apps with Xu

Xu 0.13.1 generates ARM64 projects for iOS devices, the iOS Simulator and Android. The compiler emits a native application object. The generated project includes the platform shell, the local Canvas renderer and the build script.

Generate a project

Install the full SDK, including xu-phone. The source directory must contain a xu.xun manifest. Run these commands from the root of the Xu 0.13.1 source tree. Choose a fresh output directory for each build.

xu build examples/phone_gallery --phone --target ios-simulator-arm64 --bundle-id org.example.gallery -o build/gallery-sim
xu build examples/phone_gallery --phone --target ios-arm64 --bundle-id org.example.gallery -o build/gallery-ios
xu build examples/phone_gallery --phone --target android-arm64 --bundle-id org.example.gallery -o build/gallery-android

# Native SDL GPU mobile game profile (uses #app resource packaging)
xu build examples/phone_game --phone --phone-profile game --target ios-simulator-arm64 --bundle-id org.example.game -o build/game-sim
xu build examples/phone_game --phone --phone-profile game --target android-arm64 --bundle-id org.example.game -o build/game-android

The generated projects contain the host sources and compiled object. To pick up Xu source changes, generate a fresh project before invoking the platform build.

If you keep several SDK installations, ensure that xu --version reports 0.13.1 and that any XU_ROOT and XU_STDLIB_ROOT overrides point to the same SDK.

Build on the target toolchain

Draw and handle input

Use one root ui.Window, attach #ui/draw, and record complete frames after EV_CANVAS_READY. The host renders frames in a local system WebView Canvas. Application logic runs as native ARM64 code.

Read phone.host_insets() and pass them to phone.scaffold_with to keep controls clear of safe areas and the keyboard. The mobile kit provides routes, scrolling and pull-to-refresh, native IME text editing, haptics and clipboard integration. See the #ui/phone API, the #app API, and the gallery / game examples.

The mobile profile uses one window. It omits desktop menus, dialogs, embedded WebView controls, offscreen surfaces and per-control accessibility semantics. Release checks covered project generation and ARM64 object formats. Device and app-store acceptance remain separate platform tests. Host requirements and limits