Follow this workflow to test and debug DevTools extensions locally.
When running DevTools in standalone web mode (flutter run -d chrome), DevTools does not run the devtools_server backend by default. To test extensions without a running server backend:
packages/devtools_app/lib/src/shared/development_helpers.dart.const _debugDevToolsExtensions = true;.[!WARNING] Never commit
_debugDevToolsExtensions = true;to git. A repository unit test (development_helpers_test.dart) enforces that this flag remainsfalse.
Activating stub mode registers the following mock extensions:
foo_ext (package:foo)bar_ext (package:bar)provider_ext (package:provider)The agent can automate running DevTools AND launching the browser directly to the target URL:
In packages/devtools_app, launch DevTools specifying a fixed --web-port:
flutter run -d chrome --web-port=52941
Use the system OS open command to launch Chrome/browser directly to the desired test URL:
open "http://localhost:52941/foo_ext?embedMode=one"xdg-open "http://localhost:52941/foo_ext?embedMode=one"start "http://localhost:52941/foo_ext?embedMode=one"To test against real pub package extensions:
packages/devtools_extensions/example/app_that_uses_foo:cd packages/devtools_extensions/example/app_that_uses_foo flutter run -d chrome
ws://127.0.0.1:8181/xxx=/ws).uri parameter using the appropriate OS command (as described in Step 2b):open "http://localhost:52941/foo_ext?embedMode=one&uri=<VM_SERVICE_URI>"xdg-open "http://localhost:52941/foo_ext?embedMode=one&uri=<VM_SERVICE_URI>"start "http://localhost:52941/foo_ext?embedMode=one&uri=<VM_SERVICE_URI>"When an AI agent is performing this workflow:
ask_question or a direct prompt).open, xdg-open, or start as described in Step 2b) to launch the browser automatically.