Skip to content

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

@vially

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),
    });

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