Skip to content

Commit 944aa02

Browse files
authored
Updates for developing with a local DevTools version (#8017)
This PR: - Updates the CONTRIBUTING docs to include instructions for how to run IntelliJ with a local DevTools - Changes the `devtools_tool` command to `dt` now that is has been renamed
1 parent c68c364 commit 944aa02

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

CONTRIBUTING.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ Obviously, unit tests can only be run from the command line.
379379
then adjust it to point to `flutter-intellij/third_party/lib/dart-plugin/xxx.yyyy/Dart.jar`.
380380
Delete the Dart module from the Project Structure modules list.
381381
382-
## Working with Embedded DevTools (JxBrowser)
382+
## Flutter DevTools Integration
383+
384+
### Working with Embedded DevTools (JxBrowser)
383385
384386
We use [JxBrowser](https://www.teamdev.com/jxbrowser),
385387
a commercial product, to embed DevTools within IntelliJ.
@@ -398,3 +400,17 @@ To set up the license key:
398400
1. Copy the template at resources/jxbrowser/jxbrowser.properties.template
399401
and save it as resources/jxbrowser/jxbrowser.properties.
400402
2. Replace `<KEY>` with the actual key.
403+
404+
### Developing with local DevTools
405+
406+
By default, the DevTools version in IntelliJ will match the DevTools version shipped with Flutter. To instead use a local DevTools version (which will be launched with `dt serve`), the following steps are required:
407+
408+
1. Make sure you have `dt` installed
409+
- Follow instructions in the [DevTools set-up guide](https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md#set-up-your-devtools-environment)
410+
2. Set the registry key to your DevTools directory
411+
- Go to Help > Find action > Registry > Find "flutter.local.devtools.dir" and set to your DevTools directory. (e.g. Users/user/dev/devtools)
412+
- Optional: If you want to pass additional arguments to `dt serve`, put these in the option "flutter.local.devtools.args"
413+
3. Restart IntelliJ
414+
4. Open Help > Show log in finder > Open idea.log
415+
- Verify you see output like see output `"DevTools startup: <various messages that come from running dt serve>"`
416+
5. To stop using local DevTools, go back to the registry key set in step 2 and remove it

flutter-idea/src/io/flutter/run/daemon/DevToolsService.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ private void startServer() {
140140
final String localDevToolsDir = Registry.stringValue(LOCAL_DEVTOOLS_DIR);
141141
if (!localDevToolsDir.isEmpty()) {
142142
// This is only for development to check integration with a locally run DevTools server.
143-
// The plugin will run `devtools_tool serve` and assumes that setup from
144-
// https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md has been done.
145-
// To use this option, go to Help > Find action > Registry > Set "flutter.local.devtools.dir" to your local DevTools directory,
146-
// e.g. "/Users/username/Documents/devtools".
147-
// To go back to using DevTools from the SDK (the standard way), clear out the registry setting.
143+
// To enable, follow the instructions in:
144+
// https://github.com/flutter/flutter-intellij/blob/master/CONTRIBUTING.md#developing-with-local-devtools
148145
final DtdUtils dtdUtils = new DtdUtils();
149146
try {
150147
final DartToolingDaemonService dtdService = dtdUtils.readyDtdService(project).get();
@@ -159,8 +156,7 @@ private void startServer() {
159156
args.addAll(Arrays.stream(localDevToolsArgs.split(" ")).toList());
160157
}
161158

162-
setUpInDevMode(createCommand(localDevToolsDir, "devtools_tool",
163-
args));
159+
setUpInDevMode(createCommand(localDevToolsDir, "dt", args));
164160
}
165161
catch (InterruptedException | java.util.concurrent.ExecutionException e) {
166162
throw new RuntimeException(e);

0 commit comments

Comments
 (0)