Reduce errors from androidDevice

Summary:
None of these are fatal. In fact, they're quite common for people
who've got Android enabled but no tools installed. So they're warnings
at best.

I'd like to find a way to guide people to the settings in this case
or use Doctor to disable Android support instead of retrying this
endlessly.

Reviewed By: mweststrate

Differential Revision: D26547577

fbshipit-source-id: 81e658fe3d95b2d12e76e4b635575f3e5a6fc53b
This commit is contained in:
Pascal Hartig
2021-02-22 03:35:55 -08:00
committed by Facebook GitHub Bot
parent 11d2871893
commit c010e22612

View File

@@ -144,7 +144,7 @@ export default (store: Store, logger: Logger) => {
`${emulatorPath} -list-avds`, `${emulatorPath} -list-avds`,
(error: Error | null, data: string | null) => { (error: Error | null, data: string | null) => {
if (error != null || data == null) { if (error != null || data == null) {
console.error(error || 'Failed to list AVDs'); console.warn('List AVD failed: ', error);
return; return;
} }
const payload = data.split('\n').filter(Boolean); const payload = data.split('\n').filter(Boolean);
@@ -172,7 +172,7 @@ export default (store: Store, logger: Logger) => {
.map((device: BaseDevice) => device.serial); .map((device: BaseDevice) => device.serial);
unregisterDevices(deviceIDsToRemove); unregisterDevices(deviceIDsToRemove);
console.error('adb server was shutdown'); console.warn('adb server was shutdown');
setTimeout(watchAndroidDevices, 500); setTimeout(watchAndroidDevices, 500);
} else { } else {
throw err; throw err;
@@ -206,7 +206,7 @@ export default (store: Store, logger: Logger) => {
}); });
}) })
.catch((e) => { .catch((e) => {
console.error(`Failed to watch for android devices: ${e.message}`); console.warn(`Failed to watch for android devices: ${e.message}`);
}); });
}; };