Skip to content

Improve commands #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common
14 changes: 8 additions & 6 deletions lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export class PlatformService implements IPlatformService {
return (() => {
platform = platform.toLowerCase();

this.preparePlatform(platform).wait();
if (options.emulator) {
this.deployOnEmulator(platform).wait();
} else {
Expand All @@ -194,7 +193,7 @@ export class PlatformService implements IPlatformService {
? this.debugOnEmulator(platform)
: this.debugOnDevice(platform);

return ret;
return ret;
}

public debugOnEmulator(platform: string): IFuture<void> {
Expand All @@ -210,13 +209,10 @@ export class PlatformService implements IPlatformService {
public debugOnDevice(platform: string): IFuture<void> {
return (() => {
platform = platform.toLowerCase();
var platformData = this.$platformsData.getPlatformData(platform);
var packageFile = "";
var platformData = this.$platformsData.getPlatformData(platform);

if (options["debug-brk"]) {
this.preparePlatform(platform).wait();

var cachedDeviceOption = options.forDevice;
options.forDevice = true;
this.buildPlatform(platform).wait();
Expand Down Expand Up @@ -276,7 +272,13 @@ export class PlatformService implements IPlatformService {
this.$logger.out("Using ", packageFile);

this.$devicesServices.initialize({platform: platform, deviceId: options.device}).wait();
var action = (device: Mobile.IDevice): IFuture<void> => { return device.deploy(packageFile, this.$projectData.projectId); };
var action = (device: Mobile.IDevice): IFuture<void> => {
return (() => {
device.deploy(packageFile, this.$projectData.projectId).wait();
device.runApplication(this.$projectData.projectId).wait();

}).future<void>()();
};
this.$devicesServices.execute(action).wait();

}).future<void>()();
Expand Down