Skip to content
Merged
Prev Previous commit
Next Next commit
Add verbose logging in install command
  • Loading branch information
a-wallen committed Nov 3, 2022
commit 6e1b33988d2812ec719158fecb34d8012b2de2d8
4 changes: 3 additions & 1 deletion packages/flutter_tools/lib/executable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ List<FlutterCommand> generateCommands({
artifacts: globals.artifacts!,
processManager: globals.processManager,
),
InstallCommand(),
InstallCommand(
verboseHelp: verboseHelp,
),
LogsCommand(),
MakeHostAppEditableCommand(),
PackagesCommand(),
Expand Down
6 changes: 4 additions & 2 deletions packages/flutter_tools/lib/src/commands/install.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ import '../globals.dart' as globals;
import '../runner/flutter_command.dart';

class InstallCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
InstallCommand() {
InstallCommand({
required bool verboseHelp,
}) {
addBuildModeFlags(verboseHelp: verboseHelp);
requiresPubspecYaml();
usesApplicationBinaryOption();
usesDeviceTimeoutOption();
usesDeviceUserOption();
usesFlavorOption();
addBuildModeFlags(verboseHelp: false);
argParser.addFlag('uninstall-only',
help: 'Uninstall the app if already on the device. Skip install.',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
});

testUsingContext('returns 0 when Android is connected and ready for an install', () async {
final InstallCommand command = InstallCommand();
final InstallCommand command = InstallCommand(verboseHelp: false);
command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk());

final FakeAndroidDevice device = FakeAndroidDevice();
Expand All @@ -46,7 +46,7 @@ void main() {
});

testUsingContext('returns 1 when targeted device is not Android with --device-user', () async {
final InstallCommand command = InstallCommand();
final InstallCommand command = InstallCommand(verboseHelp: false);
command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk());

final FakeIOSDevice device = FakeIOSDevice();
Expand All @@ -61,7 +61,7 @@ void main() {
});

testUsingContext('returns 0 when iOS is connected and ready for an install', () async {
final InstallCommand command = InstallCommand();
final InstallCommand command = InstallCommand(verboseHelp: false);
command.applicationPackages = FakeApplicationPackageFactory(FakeIOSApp());

final FakeIOSDevice device = FakeIOSDevice();
Expand All @@ -75,7 +75,7 @@ void main() {
});

testUsingContext('fails when prebuilt binary not found', () async {
final InstallCommand command = InstallCommand();
final InstallCommand command = InstallCommand(verboseHelp: false);
command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk());

final FakeAndroidDevice device = FakeAndroidDevice();
Expand All @@ -90,7 +90,7 @@ void main() {
});

testUsingContext('succeeds using prebuilt binary', () async {
final InstallCommand command = InstallCommand();
final InstallCommand command = InstallCommand(verboseHelp: false);
command.applicationPackages = FakeApplicationPackageFactory(FakeAndroidApk());

final FakeAndroidDevice device = FakeAndroidDevice();
Expand Down