iOS
A Rust-based Slint application can be cross-compiled to iOS and runs on iPhones, iPads, and their respective simulators. This is implemented through the Winit backend and the Skia Renderer.
Prerequisites
Section titled “Prerequisites”- A computer running macOS.
- An up-to-date installation of Xcode ↗.
- Xcodegen ↗.
- Rust ↗
- The Rust device and simulator toolchains. Run
rustup target add aarch64-apple-ios
andrustup target add aarch64-apple-ios-sim
to add them.
Adding iOS Support to an existing Rust Application
Section titled “Adding iOS Support to an existing Rust Application”The following steps assume that you have a Rust application with Slint prepared. If you’re just getting started, use our Slint Rust Template ↗ to get a minimal application running.
Use XCode to building, deploy, and submit iOS applications to the App Store. Use Xcodegen ↗ to create an Xcode project from a minimal description.
- Verify that your application compiles for iOS, by running:
cargo build --target=aarch64-apple-ios
- Create a file called
project.yml
with the following contents:
name: My Appoptions: bundleIdPrefix: com.companysettings: ENABLE_USER_SCRIPT_SANDBOXING: NOtargets: MyApp: type: application platform: iOS deploymentTarget: "12.0" info: path: Info.plist properties: UILaunchScreen: - ImageRespectSafeAreaInsets: false sources: [] postCompileScripts: - script: | ./build_for_ios_with_cargo.bash slint-rust-template outputFileLists: $TARGET_BUILD_DIR/$EXECUTABLE_PATH
Adjust the name, bundle id, and other fields as needed.
This configuration file delegates the build process to cargo through a shell script.
- In a new file called
build_for_ios_with_cargo.bash
, paste the following script code:
#!/usr/bin/env bash# Copyright © SixtyFPS GmbH <info@slint.dev># SPDX-License-Identifier: MIT
set -euvx
# Fix up PATH to work around https://github.com/rust-lang/rust/issues/80817 and add cargo.export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH:$HOME/.cargo/bin"
# based on https://github.com/mozilla/glean/blob/main/build-scripts/xc-universal-binary.sh
if [[ "$CONFIGURATION" != "Debug" ]]; then CARGO_PROFILE=release MAYBE_RELEASE=--releaseelse CARGO_PROFILE=debug MAYBE_RELEASE=fi
# Make Cargo output cache files in Xcode's directoriesexport CARGO_TARGET_DIR="$DERIVED_FILE_DIR/cargo"
IS_SIMULATOR=0if [ "${LLVM_TARGET_TRIPLE_SUFFIX-}" = "-simulator" ]; then IS_SIMULATOR=1fi
executables=()for arch in $ARCHS; do case "$arch" in arm64) if [ $IS_SIMULATOR -eq 0 ]; then CARGO_TARGET=aarch64-apple-ios else CARGO_TARGET=aarch64-apple-ios-sim fi ;; x86_64) export CFLAGS_x86_64_apple_ios="-target x86_64-apple-ios" CARGO_TARGET=x86_64-apple-ios ;; esac
cargo build $MAYBE_RELEASE --target $CARGO_TARGET --bin $1
executables+=("$DERIVED_FILE_DIR/cargo/$CARGO_TARGET/$CARGO_PROFILE/$1")done
# Combine executables, and place them at the output path excepted by Xcodelipo -create -output "$TARGET_BUILD_DIR/$EXECUTABLE_PATH" "${executables[@]}"
# Force code signing every run for device builds (non-simulator)if [ $IS_SIMULATOR -eq 0 ]; then codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" \ --entitlements "${TARGET_TEMP_DIR}/${PRODUCT_NAME}.app.xcent" \ "${TARGET_BUILD_DIR}/${EXECUTABLE_PATH}"fi
-
Make the script executable with
chmod +x build_for_ios_with_cargo.bash
. -
Run
xcodegen
to createMy App.xcodeproj
, and open it in Xcode. Now you can build, deploy, and debug your iOS application.

© 2025 SixtyFPS GmbH