A small example for a simple multiplatform (desktop + mobile) app written in Rust using the declarative UI library Nuit.
Important
This is highly experimental and currently only works on macOS and iOS. Support for more platforms, especially Linux, is planned in the future.
First make sure to have cargo-mobile2
installed, then run
cargo mobile init
Note
If the gen
folder already exists, you may have to delete it first due to tauri-apps/cargo-mobile2#351.
To run
- on desktop use
cargo run
- on iOS use
cargo apple run
- on Android use
cargo android run
Tip
For iOS and Android you can also open the project in the corresponding IDE with cargo apple open
(Xcode) and cargo android open
(Android Studio), respectively.
- The
#[mobile_entry_point]
annotation generates all the boilerplateextern
functions for mobile. - Logging on Android is done using
android_logger
.