Repository navigation
Add support for profile and release run modes for custom devices #164228
Copy link
Copy link
Closed as duplicate
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Use case
Support running Flutter apps in profile or release mode on a custom device.
The Flutter profile build mode is very useful for troubleshooting performance issues, but trying to run a Flutter app in profile or release mode on a custom device currently fails with:
$ flutter run -d my-device --profile
Profile mode is not supported by <My device>.Proposal
Add support for running Flutter apps in profile and release modes on custom devices by:
- Removing the hard-coded
debugmode check fromCustomDevice::supportsRuntimeMode
flutter/packages/flutter_tools/lib/src/custom_devices/custom_device.dart
Lines 681 to 684 in d8100ac
@override FutureOr<bool> supportsRuntimeMode(BuildMode buildMode) { return buildMode == BuildMode.debug; } - Adding a new
${buildMode}string interpolation variable to therunDebugcommand (or possibly rename the command toruninstead?):
flutter/packages/flutter_tools/lib/src/custom_devices/custom_device.dart
Lines 351 to 356 in d8100ac
final List<String> interpolated = interpolateCommand(_device._config.runDebugCommand, <String, String>{ 'remotePath': '/tmp/', 'appName': packageName, 'engineOptions': _getEngineOptionsForCmdline(debuggingOptions, traceStartup, route), });
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projecta: buildBuilding flutter applications with the toolBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
[-]Add support for `profile` or `release` run mode for custom devices[/-][+]Add support for `profile` and `release` run modes for custom devices[/+]bkonyi commentedon Apr 8, 2025
This isn't something we're going to be able to prioritize on our size given that we plan to do some refactoring to the tool in the future that would likely make this issue irrelevant. However, there's no timeline on those refactors, so we'd be willing to accept a simple PR with tests to resolve this if you're interested in contributing a fix.
vially commentedon Apr 8, 2025
@bkonyi Thank you for the reply. There is pending pull-request that adds support for this feature at #166132.
bkonyi commentedon Apr 9, 2025
Looks like I also missed that PR... 🙃 I'll take a look!
stuartmorgan-g commentedon Apr 10, 2025
Is this a duplicate of #79681 ? If not, what's the distinction?
vially commentedon Apr 11, 2025
Yes, it is a duplicate (I only found #79681 after creating this issue). Closing this one to keep all follow-up discussions in #79681.
github-actions commentedon Apr 25, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.