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

Pass correct args to ios-sim-portable's stopApplication #953

Merged
merged 1 commit into from
May 9, 2017
Merged
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 definitions/mobile.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ declare module Mobile {
uninstallApplication(appIdentifier: string): Promise<void>;
reinstallApplication(appIdentifier: string, packageFilePath: string): Promise<void>;
startApplication(appIdentifier: string): Promise<void>;
stopApplication(appIdentifier: string): Promise<void>;
stopApplication(appIdentifier: string, appName?: string): Promise<void>;
restartApplication(appIdentifier: string, appName?: string): Promise<void>;
canStartApplication(): boolean;
checkForApplicationUpdates(): Promise<void>;
Expand Down
4 changes: 2 additions & 2 deletions mobile/application-manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export abstract class ApplicationManagerBase extends EventEmitter implements Mob
}

public async restartApplication(appIdentifier: string, appName?: string): Promise<void> {
await this.stopApplication(appName || appIdentifier);
await this.stopApplication(appIdentifier, appName);
await this.startApplication(appIdentifier);
}

Expand Down Expand Up @@ -70,7 +70,7 @@ export abstract class ApplicationManagerBase extends EventEmitter implements Mob
public abstract async installApplication(packageFilePath: string): Promise<void>;
public abstract async uninstallApplication(appIdentifier: string): Promise<void>;
public abstract async startApplication(appIdentifier: string): Promise<void>;
public abstract async stopApplication(appIdentifier: string): Promise<void>;
public abstract async stopApplication(appIdentifier: string, appName?: string): Promise<void>;
public abstract async getInstalledApplications(): Promise<string[]>;
public abstract async getApplicationInfo(applicationIdentifier: string): Promise<Mobile.IApplicationInfo>;
public abstract canStartApplication(): boolean;
Expand Down
6 changes: 3 additions & 3 deletions mobile/ios/device/ios-application-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ export class IOSApplicationManager extends ApplicationManagerBase {
this.$logger.info(`Successfully run application ${appIdentifier} on device with ID ${this.device.deviceInfo.identifier}.`);
}

public async stopApplication(appIdentifier: string): Promise<void> {
public async stopApplication(appIdentifier: string, appName?: string): Promise<void> {
await this.$iosDeviceOperations.stop([{ deviceId: this.device.deviceInfo.identifier, ddi: this.$options.ddi, appId: appIdentifier }]);
}

public async restartApplication(applicationId: string): Promise<void> {
await this.stopApplication(applicationId);
public async restartApplication(applicationId: string, appName?: string): Promise<void> {
await this.stopApplication(applicationId, appName);
await this.runApplicationCore(applicationId);
}

Expand Down
5 changes: 2 additions & 3 deletions mobile/ios/simulator/ios-simulator-application-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase {
return this.iosSim.getInstalledApplications(this.identifier);
}

// TODO: Remove Promise, reason: readDirectory - cannot until android and iOS implementatios have async calls.
@hook('install')
public async installApplication(packageFilePath: string): Promise<void> {
if (this.$fs.exists(packageFilePath) && path.extname(packageFilePath) === ".zip") {
Expand Down Expand Up @@ -50,8 +49,8 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase {
}
}

public async stopApplication(cfBundleExecutable: string): Promise<void> {
return this.iosSim.stopApplication(this.identifier, cfBundleExecutable);
public async stopApplication(appIdentifier: string, appName: string): Promise<void> {
return this.iosSim.stopApplication(this.identifier, appIdentifier, appName);
}

public canStartApplication(): boolean {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"iconv-lite": "0.4.3",
"inquirer": "0.8.2",
"ios-device-lib": "~0.3.0",
"ios-sim-portable": "~2.0.0",
"ios-sim-portable": "~3.0.0",
"lodash": "4.13.1",
"log4js": "0.6.9",
"marked": "0.3.3",
Expand Down