Introducing cargo-xcodebuild: helps cargo build and run apps for iOS

38 points AnotherUniqueLogin

cargo-xcodebuild automates a lot of routines required to run Rust apps on iOS.

For example, with these small changes in your bevy/miniquad/wgpu/etc.. game, it can be run with one simple command:

1.Cargo.toml:

[lib]
crate-type = ["staticlib"]

[package.metadata.ios]
build_targets = ["aarch64-apple-ios", "aarch64-apple-ios-sim", "x86_64-apple-ios"]
  1. lib.rs:

    #[no_mangle]
    pub extern "C" fn main_rs() {
    // start game code here
    }

Running steps:

  1. Boot a simulator
  2. cargo xcodebuild run

Following instruction to run on a simulator or a device or check a README for another useful commands.