Skip to content

Commit 064aae0

Browse files
Fix stop application on iOS simulator (#2645)
We need to pass the project name instead of the app identifier to kill the application on the simulator.
1 parent b299066 commit 064aae0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/services/livesync/ios-device-livesync-service.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class IOSLiveSyncService implements INativeScriptDeviceLiveSyncService {
6262

6363
public async refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], forceExecuteFullSync: boolean, projectData: IProjectData): Promise<void> {
6464
if (forceExecuteFullSync) {
65-
await this.restartApplication(deviceAppData);
65+
await this.restartApplication(deviceAppData, projectData.projectName);
6666
return;
6767
}
6868

@@ -74,20 +74,20 @@ class IOSLiveSyncService implements INativeScriptDeviceLiveSyncService {
7474
let shouldRestart = _.some(otherFiles, (localToDevicePath: Mobile.ILocalToDevicePathData) => !this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), projectData, deviceAppData.platform));
7575

7676
if (shouldRestart || (!this.$options.liveEdit && scriptFiles.length)) {
77-
await this.restartApplication(deviceAppData);
77+
await this.restartApplication(deviceAppData, projectData.projectName);
7878
return;
7979
}
8080

8181
if (await this.setupSocketIfNeeded(projectData.projectId)) {
8282
this.liveEdit(scriptFiles);
8383
await this.reloadPage(deviceAppData, otherFiles);
8484
} else {
85-
await this.restartApplication(deviceAppData);
85+
await this.restartApplication(deviceAppData, projectData.projectName);
8686
}
8787
}
8888

89-
private async restartApplication(deviceAppData: Mobile.IDeviceAppData): Promise<void> {
90-
return this.device.applicationManager.restartApplication(deviceAppData.appIdentifier);
89+
private async restartApplication(deviceAppData: Mobile.IDeviceAppData, appName: string): Promise<void> {
90+
return this.device.applicationManager.restartApplication(deviceAppData.appIdentifier, appName);
9191
}
9292

9393
private async reloadPage(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): Promise<void> {

0 commit comments

Comments
 (0)