minikit docs v0.1.0-alpha.3

Run, hot reload, debug

minikit run                # the simulator window
minikit run --browser      # Chrome, through the simulator (bridge and inspector still work)
minikit run --chrome       # Flutter's Chrome device with LocalHost fakes: breakpoints work
minikit run -- --dart-define=API=staging   # anything after -- goes to flutter run

minikit run treats the simulator like a device:

  1. It starts the simulator if it is not running (or brings it forward).
  2. It runs flutter run -d web-server --web-port <port> in your project. The port is stable per project (run.port in minikit.yaml), so the app's web storage survives restarts.
  3. The moment Flutter prints is being served at, it asks the simulator to show the app. The simulator links the dev server through its proxy, so Flutter's hot reload reaches the preview.
  4. Keys go to Flutter: save to hot reload, r reloads, R restarts, q quits. Ctrl+C stops everything cleanly; the simulator stays open, and the preview closes.
Simulator --browser --chrome
Hot reload / restart yes yes yes
Bridge, permissions, inspector yes yes LocalHost fakes, every permission granted
DevTools yes (the IDE attaches) yes yes
Breakpoints no — the web-server device has none no yes

Use the simulator for behaviour and --chrome for stepping through code.

More than one project

Each project has its own port and Flutter process; the simulator shows the most recent one. minikit sim status lists the previews; minikit sim attach --url http://localhost:<port> brings another back.

If something is off

  • Port in use: another run of the same project is active — minikit run offers to stop it; a foreign process on the port makes minikit pick another.
  • No simulator build: minikit sim install, or run with --chrome.
  • The simulator is another version: minikit sim status says so; quit it and run again.
  • "Sign in before running a mini-app": the simulator asks for a login before an online app. minikit run requests an offline session unless you pass --online, set run.offline: false in minikit.yaml, or the manifest's authType is sso or adfs; for those, sign in to the simulator first.
  • Nothing appears in the simulator: within 45 s minikit run says whether the simulator opened the app; when it did not, the simulator window shows the reason (a rejected web/miniapp.json, for instance).
Served offline by minikit docs from your toolkit checkout. Source: docs/getting-started/run.md.