Skip to content

Commit 08e6713

Browse files
Fix PR comments
1 parent 946e944 commit 08e6713

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

lib/android-tools-info.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ export class AndroidToolsInfo implements NativeScriptDoctor.IAndroidToolsInfo {
159159
// Since this version of SDK tools, the emulator is a separate package.
160160
// However the emulator executable still exists in the "tools" dir.
161161
const pathToEmulatorFromAndroidStudio = path.join(this.androidHome, emulatorExecutableName, emulatorExecutableName);
162+
const realFilePath = this.hostInfo.isWindows ? `${pathToEmulatorFromAndroidStudio}.exe` : pathToEmulatorFromAndroidStudio;
162163

163-
if (this.fs.exists(pathToEmulatorFromAndroidStudio)) {
164+
if (this.fs.exists(realFilePath)) {
164165
this.pathToEmulatorExecutable = pathToEmulatorFromAndroidStudio;
165166
} else {
166167
this.pathToEmulatorExecutable = path.join(this.androidHome, "tools", emulatorExecutableName);

lib/doctor.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ export class Doctor implements NativeScriptDoctor.IDoctor {
4343
additionalInformation: "For Android-related operations, the NativeScript CLI will use a built-in version of adb." + EOL
4444
+ "To avoid possible issues with the native Android emulator, Genymotion or connected" + EOL
4545
+ "Android devices, verify that you have installed the latest Android SDK and" + EOL
46-
+ "its dependencies as described in http://developer.android.com/sdk/index.html#Requirements" + EOL
47-
+ this.getPackageManagerTip(),
46+
+ "its dependencies as described in http://developer.android.com/sdk/index.html#Requirements" + EOL,
4847
platforms: [Constants.ANDROID_PLATFORM_NAME]
4948
});
5049
}
@@ -54,8 +53,7 @@ export class Doctor implements NativeScriptDoctor.IDoctor {
5453
warning: "WARNING: The Android SDK is not installed or is not configured properly.",
5554
additionalInformation: "You will not be able to run your apps in the native emulator. To be able to run apps" + EOL
5655
+ "in the native Android emulator, verify that you have installed the latest Android SDK " + EOL
57-
+ "and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements" + EOL
58-
+ this.getPackageManagerTip(),
56+
+ "and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements" + EOL,
5957
platforms: [Constants.ANDROID_PLATFORM_NAME]
6058
});
6159
}
@@ -171,12 +169,4 @@ export class Doctor implements NativeScriptDoctor.IDoctor {
171169
throw new Error(`Platform ${platform} is not supported.The supported platforms are: ${Constants.SUPPORTED_PLATFORMS.join(", ")} `);
172170
}
173171
}
174-
175-
private getPackageManagerTip(): string {
176-
if (this.hostInfo.isWindows) {
177-
return "TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies." + EOL;
178-
} else if (this.hostInfo.isDarwin) {
179-
return "TIP: To avoid setting up the necessary environment variables, you can use the Homebrew package manager to install the Android SDK and its dependencies." + EOL;
180-
}
181-
}
182172
}

0 commit comments

Comments
 (0)