Support ANDROID_SDK_ROOT in addition to ANDROID_HOME (#25221)

* Fall back to ANDROID_SDK_ROOT if ANDROID_HOME is not set

And update descriptions to use the non-deprecated ANDROID_SDK_ROOT.

Fixes #15114.

* Remove trailing whitespace

* Update dev/devicelab/lib/framework/adb.dart

Co-Authored-By: DanTup <danny@tuppeny.com>

* Reformat long line
This commit is contained in:
Danny Tuppeny
2018-12-17 17:29:09 +00:00
committed by GitHub
parent f0871deb3e
commit c19142d8b7
8 changed files with 23 additions and 10 deletions

View File

@@ -461,11 +461,15 @@ class IosDevice implements Device {
/// Path to the `adb` executable.
String get adbPath {
final String androidHome = Platform.environment['ANDROID_HOME'];
final String androidHome =
Platform.environment['ANDROID_HOME'] != null
? Platform.environment['ANDROID_HOME']
: Platform.environment['ANDROID_SDK_ROOT'];
if (androidHome == null)
throw 'ANDROID_HOME environment variable missing. This variable must '
'point to the Android SDK directory containing platform-tools.';
throw 'The ANDROID_SDK_ROOT and ANDROID_HOME environment variables are '
'missing. At least one of these variables must point to the Android '
'SDK directory containing platform-tools.';
final String adbPath = path.join(androidHome, 'platform-tools/adb');