Skip to content

Add support for profile and release run modes for custom devices #164228

Closed as duplicate

Description

@vially

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:

  1. Removing the hard-coded debug mode check from CustomDevice::supportsRuntimeMode
    @override
    FutureOr<bool> supportsRuntimeMode(BuildMode buildMode) {
    return buildMode == BuildMode.debug;
    }
  2. Adding a new ${buildMode} string interpolation variable to the runDebug command (or possibly rename the command to run instead?):
    final List<String> interpolated =
    interpolateCommand(_device._config.runDebugCommand, <String, String>{
    'remotePath': '/tmp/',
    'appName': packageName,
    'engineOptions': _getEngineOptionsForCmdline(debuggingOptions, traceStartup, route),
    });

Activity

  1. changed the title [-]Add support for `profile` or `release` run mode for custom devices[/-] [+]Add support for `profile` and `release` run modes for custom devices[/+] on Feb 26, 2025
  2. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    toolAffects the "flutter" command-line tool. See also t: labels.
    c: proposalA detailed proposal for a change to Flutter
    a: buildBuilding flutter applications with the tool
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Feb 27, 2025
  3. bkonyi commented on Apr 8, 2025

    @bkonyi
    Contributor

    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.

  4. added
    P3Issues that are less important to the Flutter project
    triaged-toolTriaged by Flutter Tool team
    on Apr 8, 2025
  5. vially commented on Apr 8, 2025

    @vially
    ContributorAuthor

    @bkonyi Thank you for the reply. There is pending pull-request that adds support for this feature at #166132.

  6. bkonyi commented on Apr 9, 2025

    @bkonyi
    Contributor

    Looks like I also missed that PR... 🙃 I'll take a look!

  7. stuartmorgan-g commented on Apr 10, 2025

    @stuartmorgan-g
    Contributor

    Is this a duplicate of #79681 ? If not, what's the distinction?

  8. vially commented on Apr 11, 2025

    @vially
    ContributorAuthor

    Yes, it is a duplicate (I only found #79681 after creating this issue). Closing this one to keep all follow-up discussions in #79681.

  9. github-actions commented on Apr 25, 2025

    @github-actions

    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 -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: buildBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions