We gladly accept contributions via GitHub pull requests!
You must complete the Contributor License Agreement. You can do this online, and it only takes a minute. If you‘ve never submitted code before, you must add your (or your organization’s) name and contact info to the AUTHORS file.
git clone https://github.com/flutter/devtoolscd devtools/packages/devtools_apppub getFrom a separate terminal:
cd <path/to/flutter-sdk>/examples/flutter_galleryflutter runFrom the packages/devtools_app directory:
pub global activate webdev (install webdev globally)export PATH=$PATH:~/.pub-cache/bin (make globally activated packages available from the command line)webdev serveThen, open a browser window to the local url specified by webdev. After the page has loaded, append ?port=xxx to the url, where xxx is the port number of the service protocol port, as specified by the flutter run output.
flutter runopen http://localhost:8080webdev provides a fast development server that incrementally rebuilds the portion of the application that was edited each time you reload the page in the browser. If initial app load times become slow as this tool grows, we can integrate with the hot restart support in webdev.
If you're using VS Code to work on DevTools you can run DevTools from the editor using the VS Code tasks without having to run webdev serve in a terminal window:
F5This will serve the application in the background and launch Google Chrome. Subsequent launches will just re-launch the browser since the task remains running in the background and rebuilding as necessary.
To work on devtools_server you'll need to temporarily update the devtools pubspec to reference the local version of devtools_server and make release builds of devtools for the server to serve:
packages/devtools/pubspec.yaml uncomment the path: ../devtools_server line and comment out the version number on the line above.Run Server with Release Build configThis will produce a release build of DevTools and then debug the server (bin/devtools.dart) to serve it.
If you need to make breaking changes to DevTools that require changes to the server (such that DevTools cannot run against the live Pub version of devtools_server) it's critical that the devtools_server is released first and the version number in pubspec is updated. Please make sure this is clear on any PRs you open.
Make sure your Flutter SDK matches the tip of trunk before running these tests.
cd packages/devtools_app pub run test -j1 --tags useFlutterSdk
cd packages/devtools_app pub run test --exclude-tags useFlutterSdk pub run build_runner test -- --exclude-tags useFlutterSdk --platform chrome-no-sandbox
Some of the golden file tests will fail if Flutter changes the implementation or diagnostic properties of widgets used by the inspector tests. If this happens, make sure the golden file output still looks reasonable and execute the following command to update the golden files.
./tool/update_goldens.sh
This will update the master or stable goldens depending on whether you're on the stable Flutter branch.
All content not authored by the Flutter team must go in the third_party directory. As an expedient to make the third_party code work well with our build scripts, code in third_party should be given a stub pubspec.yaml file so that you can reference the resources from the packages directory from packages/devtools_app/web/index.html