https://xuhaojun.github.io/bevy_playground/
cargo build --release --target wasm32-unknown-unknown
~/.cargo/bin/wasm-bindgen --out-dir ./out/ --target web ./target/wasm32-unknown-unknown/release/bevy_playground.wasm
rust version: rustc 1.70.0-nightly (44f518058 2023-03-20)
sudo pacman -S mold
cargo install cargo-watch
rustup target install wasm32-unknown-unknown
cargo run
# cargo watch -cx "run"
uncomment all code in lib.rs
- should turn off optimize, that cause build long time, i don't why.
- copy main.rs to lib.rs and add
#[bevy_main]
onfn main
ANDROID_SDK_ROOT="/home/<user>/Android/Sdk/" ANDROID_NDK_ROOT="/home/<user>/Android/Sdk/ndk/<version>" cargo apk run
egui still have problem(clipboard) cause android build failed, you can fork it and apply that patch. Disable clipboard feature on Android
after build out wasm-bindgen:
cp out/* .
rm -r out
git push origin gh-pages