Skip to content

Commit cadb132

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #740 from NativeScript/fatme/default-option-for-android-debugger
Add default option for android debugger
2 parents 359807e + e343956 commit cadb132

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/services/android-debug-service.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ class AndroidDebugService implements IDebugService {
5555
return (() => {
5656
let packageFile = "";
5757

58-
if (this.$options.debugBrk) {
59-
this.$platformService.preparePlatform(this.platform).wait();
58+
if(!this.$options.debugBrk && !this.$options.start) {
59+
this.$logger.warn("Neither --debug-brk nor --start option was specified. Defaulting to --debug-brk.");
60+
this.$options.debugBrk = true;
61+
}
6062

63+
if (this.$options.debugBrk) {
6164
let cachedDeviceOption = this.$options.forDevice;
6265
this.$options.forDevice = true;
6366
this.$platformService.buildPlatform(this.platform).wait();
@@ -87,8 +90,6 @@ class AndroidDebugService implements IDebugService {
8790
this.detachDebugger(packageName).wait();
8891
} else if (this.$options.debugBrk) {
8992
this.startAppWithDebugger(packageFile, packageName).wait();
90-
} else {
91-
this.$logger.info("Should specify at least one option: debug-brk, start, stop, get-port.");
9293
}
9394
}).future<void>()();
9495
}

0 commit comments

Comments
 (0)