Skip to content

Instantly share code, notes, and snippets.

@dkbast
Created December 16, 2022 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkbast/6af0c48eda59817b525798743f737918 to your computer and use it in GitHub Desktop.
Save dkbast/6af0c48eda59817b525798743f737918 to your computer and use it in GitHub Desktop.
A shell script to easily setup and test the remote flutter widget WASM example on MacOS
# A shell script which sets everything up to run the rfw wasm example
# Setup Rust:
brew install rustup
rustup-init
source "$HOME/.cargo/env"
# clone the project
git clone https://github.com/flutter/packages.git
cd packages/packages/rfw
cd example/wasm
# Add internet access to the debug entitlements:
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>' > macos/Runner/DebugProfile.entitlements
# get dependencies
flutter pub get
# initialize wasm and build wasm runtime, this is why we need rust
flutter pub run wasm:setup
# build and run the wasm example
flutter run -d macos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment