C.W.K.
Stream
Lesson 02 of 05 · published

iOS & Android: init and dev

~14 min · tauri, mobile, ios, android

Level 0Web Tourist
0 XP0/56 lessons0/13 achievements
0/100 XP to next level100 XP to go0% complete
"Mobile init generates a real Xcode and Gradle project. You're not escaping the native toolchains — Tauri is driving them for you."

The Prerequisites Are Heavier

Desktop Tauri needs modest tooling; mobile needs the full native stacks. For iOS: a Mac, the full Xcode app (not just Command Line Tools), CocoaPods, and the iOS Rust targets. For Android: Android Studio with the SDK and NDK, the right environment variables (ANDROID_HOME, NDK_HOME), and the Android Rust targets. Add the targets with rustup target add. Skipping any of these is the usual reason init or dev fails on the first try.

init Generates the Platform Projects

tauri ios init and tauri android init generate native projects (under src-tauri/gen/apple and gen/android) using cargo-mobile2 under the hood. These are real Xcode/Gradle projects that wrap your Tauri app — you usually don't hand-edit them, but they're where platform-specific signing and config live. Decide deliberately whether to commit gen/ (regenerable, but holds some config you may customize) or gitignore it and regenerate in CI.

dev Runs on Simulator or Device

tauri ios dev and tauri android dev build and launch your app on a simulator/emulator or a connected device, with the same frontend hot-reload you know from desktop. This is your mobile inner loop. The first run is slow (compiling for a new target), and you may need to select a device/simulator and handle signing prompts — but once running, editing the frontend updates live on the phone just like on desktop.

Code

Targets, init, dev·bash
# Add the Rust targets for mobile (once).
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
rustup target add aarch64-linux-android armv7-linux-androideabi \
  i686-linux-android x86_64-linux-android

# Generate the native platform projects.
npm run tauri ios init
npm run tauri android init

# Run on a simulator/emulator or device (hot-reload, like desktop).
npm run tauri ios dev
npm run tauri android dev

External links

Exercise

If you have the toolchains, add the Rust mobile targets and run tauri android init (or ios init on a Mac), then tauri android dev to get your existing app onto an emulator. If you can't install the full stacks right now, instead write down the exact prerequisites for each platform and why mobile needs more than desktop. Either way, you'll know what 'going mobile' costs in setup.
Hint
rustup target add for the platform triples; full Xcode + CocoaPods for iOS; Android Studio SDK/NDK + ANDROID_HOME/NDK_HOME for Android. The first dev run compiles for the new target, so expect a wait.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.