Commit da5a64ec authored by Danny Tuppeny's avatar Danny Tuppeny Committed by Danny Tuppeny

More Windows fixes

Added an exists check to ensure we don't try to run if emulator is missing, but that requires the file extension for Windows.
parent 03b5fe3d
...@@ -245,7 +245,7 @@ class AndroidSdk { ...@@ -245,7 +245,7 @@ class AndroidSdk {
String get adbPath => getPlatformToolsPath('adb'); String get adbPath => getPlatformToolsPath('adb');
String get emulatorPath => getToolsPath('emulator'); String get emulatorPath => getEmulatorPath();
/// Validate the Android SDK. This returns an empty list if there are no /// Validate the Android SDK. This returns an empty list if there are no
/// issues; otherwise, it returns a list of issues found. /// issues; otherwise, it returns a list of issues found.
...@@ -263,8 +263,17 @@ class AndroidSdk { ...@@ -263,8 +263,17 @@ class AndroidSdk {
return fs.path.join(directory, 'platform-tools', binaryName); return fs.path.join(directory, 'platform-tools', binaryName);
} }
String getToolsPath(String binaryName) { String getEmulatorPath() {
return fs.path.join(directory, 'tools', binaryName); final String binaryName = platform.isWindows ? 'emulator.exe' : 'emulator';
// Emulator now lives inside "emulator" but used to live inside "tools" so
// try both.
final List<String> searchFolders = <String>['emulator', 'tools'];
for (final String folder in searchFolders) {
final String path = fs.path.join(directory, folder, binaryName);
if (fs.file(path).existsSync())
return path;
}
return null;
} }
void _init() { void _init() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment