Skip to content

Commit 49a9003

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Ability to specify android debug ui not only on OSX
Fixes #923
1 parent 5b07c7f commit 49a9003

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

lib/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class Configuration extends configBaseLib.ConfigBase implements IConfigur
1010
DEBUG = false;
1111
TYPESCRIPT_COMPILER_OPTIONS = {};
1212
USE_PROXY = false;
13-
ANDROID_DEBUG_UI_MAC = "Google Chrome";
13+
ANDROID_DEBUG_UI: string = null;
1414

1515
/*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/
1616
constructor(protected $fs: IFileSystem) {

lib/declarations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface IDependencyData {
3535
interface IStaticConfig extends Config.IStaticConfig { }
3636

3737
interface IConfiguration extends Config.IConfig {
38-
ANDROID_DEBUG_UI_MAC: string;
38+
ANDROID_DEBUG_UI: string;
3939
}
4040

4141
interface IApplicationPackage {

lib/services/android-debug-service.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,19 @@ class AndroidDebugService implements IDebugService {
170170
}
171171

172172
private openDebuggerClient(url: string): void {
173-
let chrome = this.$hostInfo.isDarwin ? this.$config.ANDROID_DEBUG_UI_MAC : "chrome";
174-
let child = this.$opener.open(url, chrome);
173+
let defaultDebugUI = "chrome";
174+
if(this.$hostInfo.isDarwin) {
175+
defaultDebugUI = "Google Chrome";
176+
}
177+
if(this.$hostInfo.isLinux) {
178+
defaultDebugUI = "google-chrome";
179+
}
180+
181+
let debugUI = this.$config.ANDROID_DEBUG_UI || defaultDebugUI;
182+
let child = this.$opener.open(url, debugUI);
175183
if(!child) {
176-
this.$errors.fail(`Unable to open ${chrome}.`);
184+
this.$errors.failWithoutHelp(`Unable to open ${debugUI}.`);
177185
}
178-
return child;
179186
}
180187

181188
private checkIfRunning(packageName: string): boolean {

0 commit comments

Comments
 (0)