Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
11 changes: 3 additions & 8 deletions lib/commands/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<boolean> {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down