Browse Source

Add better instructions

Jonathan Kelley 2 years ago
parent
commit
4343abf76d
2 changed files with 31 additions and 5 deletions
  1. 31 5
      examples/ios_demo/README.md
  2. BIN
      examples/ios_demo/ios_demo.png

+ 31 - 5
examples/ios_demo/README.md

@@ -1,9 +1,35 @@
-# wry
+# Dioxus Mobile demo
 
-## iOS
+## How this project was generated
 
-Must run Xcode on rosetta. Goto Application > Right Click Xcode > Get Info > Open in Rosetta.
+Right now, Dioxus supports mobile targets including iOS and Android. However, our tooling is not mature enough to include the build commands directly.
 
-If you are using M1, you will have to run `cargo build --target x86_64-apple-ios` instead of `cargo apple build` if you want to run in simulator.
+This project was generated using [tauri-mobile](https://github.com/tauri-apps/tauri-mobile). We have yet to integrate this generation into the Dioxus-CLI. The open issue for this is [#1157](https://github.com/DioxusLabs/dioxus/issues/1157).
+
+## Running on iOS
+
+First, you'll want to make sure you have the appropriate iOS targets installed.
+
+The two targets you'll use the most are:
+
+- `aarch64-apple-ios-sim`
+- `aarch64-apple-ios`
+
+These can be added using
+- `rustup target add aarch64-apple-ios-sim`
+- `rustup target add aarch64-apple-ios`
+
+From there, you'll want to get a build of the crate using whichever platform you're targeting (simulator or actual hardware). For now, we'll just stick with the simulator:
+- `cargo build --target aarch64-apple-ios-sim`
+
+Then, you'll want to open XCode. This might take awhile if you've never opened XCode before. The command you want to use is:
+- `cargo apple open`
+
+This will open XCode with this particular project.
+
+From there, just click the "play" button with the right target and the app should be running!
+
+![ios_demo](ios_demo.png)
+
+Note that clicking play doesn't cause a new build, so you'll need to keep rebuilding the app between changes. The tooling here is very young, so please be patient. If you want to contribute to make things easier, please do! We'll be happy to help.
 
-Otherwise, it's all `cargo apple run` when running in actual device.

BIN
examples/ios_demo/ios_demo.png