diff --git a/lib/config.ts b/lib/config.ts index 65a729673e..f11fcf3d25 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -10,7 +10,7 @@ export class Configuration extends configBaseLib.ConfigBase implements IConfigur DEBUG = false; TYPESCRIPT_COMPILER_OPTIONS = {}; USE_PROXY = false; - ANDROID_DEBUG_UI_MAC = "Google Chrome"; + ANDROID_DEBUG_UI: string = null; /*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/ constructor(protected $fs: IFileSystem) { diff --git a/lib/declarations.ts b/lib/declarations.ts index 756208bc43..5a9e54722a 100644 --- a/lib/declarations.ts +++ b/lib/declarations.ts @@ -35,7 +35,7 @@ interface IDependencyData { interface IStaticConfig extends Config.IStaticConfig { } interface IConfiguration extends Config.IConfig { - ANDROID_DEBUG_UI_MAC: string; + ANDROID_DEBUG_UI: string; } interface IApplicationPackage { diff --git a/lib/services/android-debug-service.ts b/lib/services/android-debug-service.ts index a35f90c112..0419234f6b 100644 --- a/lib/services/android-debug-service.ts +++ b/lib/services/android-debug-service.ts @@ -170,12 +170,19 @@ class AndroidDebugService implements IDebugService { } private openDebuggerClient(url: string): void { - let chrome = this.$hostInfo.isDarwin ? this.$config.ANDROID_DEBUG_UI_MAC : "chrome"; - let child = this.$opener.open(url, chrome); + let defaultDebugUI = "chrome"; + if(this.$hostInfo.isDarwin) { + defaultDebugUI = "Google Chrome"; + } + if(this.$hostInfo.isLinux) { + defaultDebugUI = "google-chrome"; + } + + let debugUI = this.$config.ANDROID_DEBUG_UI || defaultDebugUI; + let child = this.$opener.open(url, debugUI); if(!child) { - this.$errors.fail(`Unable to open ${chrome}.`); + this.$errors.failWithoutHelp(`Unable to open ${debugUI}.`); } - return child; } private checkIfRunning(packageName: string): boolean {