diff --git a/packages/flutter_tools/lib/src/android/android_device_discovery.dart b/packages/flutter_tools/lib/src/android/android_device_discovery.dart index 9d2fd5ef99..a250b36094 100644 --- a/packages/flutter_tools/lib/src/android/android_device_discovery.dart +++ b/packages/flutter_tools/lib/src/android/android_device_discovery.dart @@ -74,7 +74,8 @@ class AndroidDevices extends PollingDeviceDiscovery { } on ProcessException catch (exception) { throwToolExit( 'Unable to run "adb", check your Android SDK installation and ' - '$kAndroidHome environment variable: ${exception.executable}', + '$kAndroidHome environment variable: ${exception.executable}\n' + 'Error details: ${exception.message}', ); } final List devices = []; diff --git a/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart index 2f2135df0e..86eedc920e 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart @@ -87,6 +87,7 @@ void main() { const FakeCommand( command: ['adb', 'devices', '-l'], exitCode: 1, + stderr: '' ), ]); final AndroidDevices androidDevices = AndroidDevices( @@ -99,8 +100,15 @@ void main() { userMessages: UserMessages(), ); - expect(androidDevices.pollingGetDevices(), - throwsToolExit(message: RegExp('Unable to run "adb"'))); + expect( + androidDevices.pollingGetDevices(), + throwsToolExit( + message: + 'Unable to run "adb", check your Android SDK installation and ANDROID_HOME environment variable: adb\n' + 'Error details: Process exited abnormally with exit code 1:\n' + '', + ), + ); }); testWithoutContext('AndroidDevices is disabled if feature is disabled', () {