A simple module that demonstrates usage of the Dart Inspect API.
Assumes you already have an existing Fuchsia checkout and have set-up your hardware.
Run for workstation.
fx set workstation.chromebook-x64 --with //bundles:kitchen_sink
Do a fresh build.
fx full-build
Connect and turn on the desired device. Serve to hardware.
fx serve
(If this is your first time building the example app) You may need to run:
fx ota
in order to have access to iquery.
(Once the UI comes up) Login as a Guest user.
Click on the (+) icon and select “Guest”. This only needs to be done once on initial setup.
Add the Inspect mod.
fx shell sessionctl add_mod fuchsia-pkg://fuchsia.com/inspect_mod#meta/inspect_mod.cmx
You should see the mod appear on the device.
View iquery output. This saves a step of looking for the mod because we know the mod is “inspect_mod.cmx” and that its root Inspect object is named “root.inspect”.
fx shell iquery --recursive `fx shell iquery --find /hub | grep inspect_mod.cmx | grep root.inspect`
Each time you make local Dart changes and want to see the changes, you'll want to rebuild and re-add the inspect mod. This can be done in one command.
fx build && fx shell sessionctl restart_session && fx shell sessionctl add_mod fuchsia-pkg://fuchsia.com/inspect_mod#meta/inspect_mod.cmx
Restarting the session is unnecessary, but it tends to be easier than manually closing the old mod in the UI before adding a new one (to avoid cluttering the device with multiple mods during development).