From cf3e10ab3c3c9e2b6e912b74a40142bc187beec4 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 4 May 2017 20:02:22 +0300 Subject: [PATCH] Pass correct args to ios-sim-portable's stopApplication When Xcode 8 or later is installed, ios-sim-portable will spawn `xcrun simctl terminate ` in order to stop the application. For earlier version the command for stopping the app is `killall `. So pass correct args to the method. Update ios-sim-portable, where the change is implemented. --- lib/commands/debug.ts | 11 +++-------- lib/common | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/commands/debug.ts b/lib/commands/debug.ts index e0ac47dd3a..2a026f0bb0 100644 --- a/lib/commands/debug.ts +++ b/lib/commands/debug.ts @@ -6,7 +6,6 @@ export abstract class DebugPlatformCommand implements ICommand { constructor(private debugService: IPlatformDebugService, private $devicesService: Mobile.IDevicesService, private $injector: IInjector, - private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, private $config: IConfiguration, private $usbLiveSyncService: ILiveSyncService, private $debugDataService: IDebugDataService, @@ -49,11 +48,7 @@ export abstract class DebugPlatformCommand implements ICommand { await this.debugService.debugStop(); let applicationId = deviceAppData.appIdentifier; - if (deviceAppData.device.isEmulator && deviceAppData.platform.toLowerCase() === this.$devicePlatformsConstants.iOS.toLowerCase()) { - applicationId = projectData.projectName; - } - - await deviceAppData.device.applicationManager.stopApplication(applicationId); + await deviceAppData.device.applicationManager.stopApplication(applicationId, projectData.projectName); const buildConfig: IBuildConfig = _.merge({ buildForDevice: !deviceAppData.device.isEmulator }, deployOptions); debugData.pathToAppPackage = this.$platformService.lastOutputPath(this.debugService.platform, buildConfig, projectData); @@ -102,7 +97,7 @@ export class DebugIOSCommand extends DebugPlatformCommand { $projectData: IProjectData, $platformsData: IPlatformsData, $iosDeviceOperations: IIOSDeviceOperations) { - super($iOSDebugService, $devicesService, $injector, $devicePlatformsConstants, $config, $usbLiveSyncService, $debugDataService, $platformService, $projectData, $options, $platformsData, $logger); + super($iOSDebugService, $devicesService, $injector, $config, $usbLiveSyncService, $debugDataService, $platformService, $projectData, $options, $platformsData, $logger); // Do not dispose ios-device-lib, so the process will remain alive and the debug application (NativeScript Inspector or Chrome DevTools) will be able to connect to the socket. // In case we dispose ios-device-lib, the socket will be closed and the code will fail when the debug application tries to read/send data to device socket. // That's why the `$ tns debug ios --justlaunch` command will not release the terminal. @@ -136,7 +131,7 @@ export class DebugAndroidCommand extends DebugPlatformCommand { $options: IOptions, $projectData: IProjectData, $platformsData: IPlatformsData) { - super($androidDebugService, $devicesService, $injector, $devicePlatformsConstants, $config, $usbLiveSyncService, $debugDataService, $platformService, $projectData, $options, $platformsData, $logger); + super($androidDebugService, $devicesService, $injector, $config, $usbLiveSyncService, $debugDataService, $platformService, $projectData, $options, $platformsData, $logger); } public async canExecute(args: string[]): Promise { diff --git a/lib/common b/lib/common index b96484eb79..a6128811a7 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit b96484eb79704a84a6b2e3f94376072ac77065d8 +Subproject commit a6128811a7416268b98aa73023cf725b80348ff4 diff --git a/package.json b/package.json index 25c695373e..b0ff51b42e 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "inquirer": "0.9.0", "ios-device-lib": "0.4.1", "ios-mobileprovision-finder": "1.0.9", - "ios-sim-portable": "~2.0.0", + "ios-sim-portable": "~3.0.0", "lockfile": "1.0.1", "lodash": "4.13.1", "log4js": "1.0.1",