Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Fix run, livesync, run workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatme Havaluova authored and Fatme Havaluova committed Sep 10, 2015
1 parent 09f4889 commit 2d5439e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions definitions/mobile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ declare module Mobile {
getInstalledApplications(): IFuture<string[]>;
installApplication(packageFilePath: string): IFuture<void>;
uninstallApplication(appIdentifier: string): IFuture<void>;
reinstallApplication(applicationId: string, packageFilePath: string): IFuture<void>;
startApplication(appIdentifier: string): IFuture<void>;
stopApplication(appIdentifier: string): IFuture<void>;
restartApplication(applicationId: string): IFuture<void>;
Expand Down
7 changes: 7 additions & 0 deletions mobile/android/android-application-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export class AndroidApplicationManager implements Mobile.IDeviceApplicationManag
return this.adb.executeShellCommand(["pm", "uninstall", `${appIdentifier}`]);
}

public reinstallApplication(applicationId: string, packageFilePath: string): IFuture<void> {
return (() => {
this.uninstallApplication(applicationId).wait();
this.installApplication(packageFilePath).wait();
}).future<void>()();
}

public startApplication(appIdentifier: string): IFuture<void> {
return this.adb.executeShellCommand(["am", "start",
"-a", "android.intent.action.MAIN",
Expand Down
3 changes: 1 addition & 2 deletions mobile/android/android-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export class AndroidDevice implements Mobile.IAndroidDevice {

public deploy(packageFile: string, packageName: string): IFuture<void> {
return (() => {
this.applicationManager.uninstallApplication(packageName).wait();
this.applicationManager.installApplication(packageFile).wait();
this.applicationManager.reinstallApplication(packageName, packageFile).wait();
this.applicationManager.startApplication(packageName).wait();
this.$logger.info("Successfully deployed on device with identifier '%s'", this.identifier);
}).future<void>()();
Expand Down
7 changes: 7 additions & 0 deletions mobile/ios/ios-application-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ export class IOSApplicationManager implements Mobile.IDeviceApplicationManager {
}).future<void>()();
}

public reinstallApplication(applicationId: string, packageFilePath: string): IFuture<void> {
return (() => {
this.uninstallApplication(applicationId).wait();
this.installApplication(packageFilePath).wait();
}).future<void>()();
}

public startApplication(applicationId: string): IFuture<void> {
return (() => {
if(this.$hostInfo.isWindows && !this.$staticConfig.enableDeviceRunCommandOnWindows) {
Expand Down
4 changes: 2 additions & 2 deletions mobile/ios/ios-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ export class IOSDevice implements Mobile.IiOSDevice {
return this.tryExecuteFunction<number>(func);
}

public deploy(packageFile: string): IFuture<void> {
return this.applicationManager.installApplication(packageFile);
public deploy(packageFile: string, packageName: string): IFuture<void> {
return this.applicationManager.reinstallApplication(packageName, packageFile);
}

public openDeviceLogStream() {
Expand Down

0 comments on commit 2d5439e

Please sign in to comment.