Skip to content

Commit

Permalink
Merge pull request #740 from NativeScript/fatme/default-option-for-an…
Browse files Browse the repository at this point in the history
…droid-debugger

Add default option for android debugger
  • Loading branch information
Fatme authored and Fatme committed Aug 4, 2015
2 parents 359807e + e343956 commit cadb132
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/services/android-debug-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ class AndroidDebugService implements IDebugService {
return (() => {
let packageFile = "";

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

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

0 comments on commit cadb132

Please sign in to comment.