diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index e0f058e074..ed1d9ae536 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -230,13 +230,15 @@ class AndroidDevice extends _Device { _adbPath = _getAdbPath(); _hasAdb = _checkForAdb(); - // Checking for lollipop only needs to be done if we are starting an - // app, but it has an important side effect, which is to discard any - // progress messages if the adb server is restarted. - _hasValidAndroid = _checkForLollipopOrLater(); + if (isConnected()) { + // Checking for lollipop only needs to be done if we are starting an + // app, but it has an important side effect, which is to discard any + // progress messages if the adb server is restarted. + _hasValidAndroid = _checkForLollipopOrLater(); - if (!_hasAdb || !_hasValidAndroid) { - _logging.severe('Unable to run on Android.'); + if (!_hasAdb || !_hasValidAndroid) { + _logging.severe('Unable to run on Android.'); + } } }