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

Commit a612881

Browse files
Merge pull request #953 from telerik/vladimirov/fix-stop-start-sim-app
Pass correct args to ios-sim-portable's stopApplication
2 parents b96484e + 5871918 commit a612881

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

definitions/mobile.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ declare module Mobile {
238238
uninstallApplication(appIdentifier: string): Promise<void>;
239239
reinstallApplication(appIdentifier: string, packageFilePath: string): Promise<void>;
240240
startApplication(appIdentifier: string): Promise<void>;
241-
stopApplication(appIdentifier: string): Promise<void>;
241+
stopApplication(appIdentifier: string, appName?: string): Promise<void>;
242242
restartApplication(appIdentifier: string, appName?: string): Promise<void>;
243243
canStartApplication(): boolean;
244244
checkForApplicationUpdates(): Promise<void>;

mobile/application-manager-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export abstract class ApplicationManagerBase extends EventEmitter implements Mob
1717
}
1818

1919
public async restartApplication(appIdentifier: string, appName?: string): Promise<void> {
20-
await this.stopApplication(appName || appIdentifier);
20+
await this.stopApplication(appIdentifier, appName);
2121
await this.startApplication(appIdentifier);
2222
}
2323

@@ -70,7 +70,7 @@ export abstract class ApplicationManagerBase extends EventEmitter implements Mob
7070
public abstract async installApplication(packageFilePath: string): Promise<void>;
7171
public abstract async uninstallApplication(appIdentifier: string): Promise<void>;
7272
public abstract async startApplication(appIdentifier: string): Promise<void>;
73-
public abstract async stopApplication(appIdentifier: string): Promise<void>;
73+
public abstract async stopApplication(appIdentifier: string, appName?: string): Promise<void>;
7474
public abstract async getInstalledApplications(): Promise<string[]>;
7575
public abstract async getApplicationInfo(applicationIdentifier: string): Promise<Mobile.IApplicationInfo>;
7676
public abstract canStartApplication(): boolean;

mobile/ios/device/ios-application-manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ export class IOSApplicationManager extends ApplicationManagerBase {
8787
this.$logger.info(`Successfully run application ${appIdentifier} on device with ID ${this.device.deviceInfo.identifier}.`);
8888
}
8989

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

94-
public async restartApplication(applicationId: string): Promise<void> {
95-
await this.stopApplication(applicationId);
94+
public async restartApplication(applicationId: string, appName?: string): Promise<void> {
95+
await this.stopApplication(applicationId, appName);
9696
await this.runApplicationCore(applicationId);
9797
}
9898

mobile/ios/simulator/ios-simulator-application-manager.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase {
2020
return this.iosSim.getInstalledApplications(this.identifier);
2121
}
2222

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

53-
public async stopApplication(cfBundleExecutable: string): Promise<void> {
54-
return this.iosSim.stopApplication(this.identifier, cfBundleExecutable);
52+
public async stopApplication(appIdentifier: string, appName: string): Promise<void> {
53+
return this.iosSim.stopApplication(this.identifier, appIdentifier, appName);
5554
}
5655

5756
public canStartApplication(): boolean {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"iconv-lite": "0.4.3",
3939
"inquirer": "0.8.2",
4040
"ios-device-lib": "~0.3.0",
41-
"ios-sim-portable": "~2.0.0",
41+
"ios-sim-portable": "~3.0.0",
4242
"lodash": "4.13.1",
4343
"log4js": "0.6.9",
4444
"marked": "0.3.3",

0 commit comments

Comments
 (0)