mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
include exception details in tool exit displayed when adb call fails (#147498)
Fixes #125971
This commit is contained in:
parent
af270935bb
commit
ce822ec8bb
@ -74,7 +74,8 @@ class AndroidDevices extends PollingDeviceDiscovery {
|
|||||||
} on ProcessException catch (exception) {
|
} on ProcessException catch (exception) {
|
||||||
throwToolExit(
|
throwToolExit(
|
||||||
'Unable to run "adb", check your Android SDK installation and '
|
'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<AndroidDevice> devices = <AndroidDevice>[];
|
final List<AndroidDevice> devices = <AndroidDevice>[];
|
||||||
|
@ -87,6 +87,7 @@ void main() {
|
|||||||
const FakeCommand(
|
const FakeCommand(
|
||||||
command: <String>['adb', 'devices', '-l'],
|
command: <String>['adb', 'devices', '-l'],
|
||||||
exitCode: 1,
|
exitCode: 1,
|
||||||
|
stderr: '<stderr from adb>'
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
final AndroidDevices androidDevices = AndroidDevices(
|
final AndroidDevices androidDevices = AndroidDevices(
|
||||||
@ -99,8 +100,15 @@ void main() {
|
|||||||
userMessages: UserMessages(),
|
userMessages: UserMessages(),
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(androidDevices.pollingGetDevices(),
|
expect(
|
||||||
throwsToolExit(message: RegExp('Unable to run "adb"')));
|
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'
|
||||||
|
'<stderr from adb>',
|
||||||
|
),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWithoutContext('AndroidDevices is disabled if feature is disabled', () {
|
testWithoutContext('AndroidDevices is disabled if feature is disabled', () {
|
||||||
|
Loading…
Reference in New Issue
Block a user