Skip to content

Commit 2f59919

Browse files
Jonah Williamsfluttergithubbot
authored andcommitted
[flutter_tools] Reland fast start by default for Android (flutter#49315)
1 parent 782f9cc commit 2f59919

File tree

7 files changed

+12
-19
lines changed

7 files changed

+12
-19
lines changed

dev/devicelab/bin/tasks/commands_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main() {
2626
print('run: starting...');
2727
final Process run = await startProcess(
2828
path.join(flutterDirectory.path, 'bin', 'flutter'),
29-
<String>['run', '--verbose', '--disable-service-auth-codes', '-d', device.deviceId, 'lib/commands.dart'],
29+
<String>['run', '--verbose', '--disable-service-auth-codes', '--no-fast-start', '-d', device.deviceId, 'lib/commands.dart'],
3030
);
3131
final StreamController<String> stdout = StreamController<String>.broadcast();
3232
run.stdout

dev/devicelab/bin/tasks/named_isolates_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main() {
2626
Completer<void> firstNameFound = Completer<void>();
2727
Completer<void> secondNameFound = Completer<void>();
2828
final Process runProcess = await _run(device: device, command:
29-
<String>['run', '--disable-service-auth-codes'], stdoutListener: (String line) {
29+
<String>['run', '--disable-service-auth-codes', '--no-fast-start'], stdoutListener: (String line) {
3030
if (line.contains(_kFirstIsolateName)) {
3131
firstNameFound.complete();
3232
} else if (line.contains(_kSecondIsolateName)) {

dev/devicelab/bin/tasks/run_machine_concurrent_hot_reload.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void main() {
4848
'run',
4949
'--machine',
5050
'--verbose',
51+
'--no-fast-start',
5152
'-d',
5253
device.deviceId,
5354
'lib/commands.dart',

dev/devicelab/bin/tasks/service_extensions_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void main() {
2525
print('run: starting...');
2626
final Process run = await startProcess(
2727
path.join(flutterDirectory.path, 'bin', 'flutter'),
28-
<String>['run', '--verbose', '--disable-service-auth-codes', '-d', device.deviceId, 'lib/main.dart'],
28+
<String>['run', '--verbose', '--no-fast-start', '--disable-service-auth-codes', '-d', device.deviceId, 'lib/main.dart'],
2929
);
3030
run.stdout
3131
.transform<String>(utf8.decoder)

dev/devicelab/lib/tasks/perf_tests.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ class ReportedDurationTest {
719719
print('launching $project$test on device...');
720720
await flutter('run', options: <String>[
721721
'--verbose',
722+
'--no-fast-start',
722723
'--${_reportedDurationTestToString(flavor)}',
723724
'--no-resident',
724725
'-d', device.deviceId,

packages/flutter_tools/lib/src/commands/run.dart

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ class RunCommand extends RunCommandBase {
189189
)
190190
..addFlag('fast-start',
191191
negatable: true,
192-
defaultsTo: false,
193-
hide: true,
192+
defaultsTo: true,
194193
help: 'Whether to quickly bootstrap applications with a minimal app. '
195194
'Currently this is only supported on Android devices. This option '
196195
'cannot be paired with --use-application-binary.'
@@ -319,10 +318,6 @@ class RunCommand extends RunCommandBase {
319318
await super.validateCommand();
320319
}
321320

322-
if (boolArg('fast-start') && runningWithPrebuiltApplication) {
323-
throwToolExit('--fast-start is not supported with --use-application-binary');
324-
}
325-
326321
devices = await findAllTargetDevices();
327322
if (devices == null) {
328323
throwToolExit(null);
@@ -365,7 +360,9 @@ class RunCommand extends RunCommandBase {
365360
vmserviceOutFile: stringArg('vmservice-out-file'),
366361
// Allow forcing fast-start to off to prevent doing more work on devices that
367362
// don't support it.
368-
fastStart: boolArg('fast-start') && devices.every((Device device) => device.supportsFastStart),
363+
fastStart: boolArg('fast-start')
364+
&& !runningWithPrebuiltApplication
365+
&& devices.every((Device device) => device.supportsFastStart),
369366
);
370367
}
371368
}
@@ -428,12 +425,6 @@ class RunCommand extends RunCommandBase {
428425
}
429426

430427
for (final Device device in devices) {
431-
if (!device.supportsFastStart && boolArg('fast-start')) {
432-
globals.printStatus(
433-
'Using --fast-start option with device ${device.name}, but this device '
434-
'does not support it. Overriding the setting to false.'
435-
);
436-
}
437428
if (await device.isLocalEmulator) {
438429
if (await device.supportsHardwareRendering) {
439430
final bool enableSoftwareRendering = boolArg('enable-software-rendering') == true;

packages/flutter_tools/test/commands.shard/hermetic/run_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void main() {
7777
]);
7878
fail('Expect exception');
7979
} catch (e) {
80-
expect(e.toString(), contains('--fast-start is not supported with --use-application-binary'));
80+
expect(e.toString(), isNot(contains('--fast-start is not supported with --use-application-binary')));
8181
}
8282
}, overrides: <Type, Generator>{
8383
FileSystem: () => MemoryFileSystem(),
@@ -115,10 +115,10 @@ void main() {
115115
}
116116

117117
final BufferLogger bufferLogger = globals.logger as BufferLogger;
118-
expect(bufferLogger.statusText, contains(
118+
expect(bufferLogger.statusText, isNot(contains(
119119
'Using --fast-start option with device mockdevice, but this device '
120120
'does not support it. Overriding the setting to false.'
121-
));
121+
)));
122122
}, overrides: <Type, Generator>{
123123
FileSystem: () => MemoryFileSystem(),
124124
ProcessManager: () => FakeProcessManager.any(),

0 commit comments

Comments
 (0)