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:
- It starts the simulator if it is not running (or brings it forward).
- It runs
flutter run -d web-server --web-port <port>in your project. The port is stable per project (run.portinminikit.yaml), so the app's web storage survives restarts. - 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.
- Keys go to Flutter: save to hot reload,
rreloads,Rrestarts,qquits. 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 runoffers 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 statussays so; quit it and run again. - "Sign in before running a mini-app": the simulator asks for a login before an online app.
minikit runrequests an offline session unless you pass--online, setrun.offline: falseinminikit.yaml, or the manifest'sauthTypeisssooradfs; for those, sign in to the simulator first. - Nothing appears in the simulator: within 45 s
minikit runsays whether the simulator opened the app; when it did not, the simulator window shows the reason (a rejectedweb/miniapp.json, for instance).