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

Commit 5e6ac64

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #391 from telerik/fatme/fix-ios-livesync
Fix livesync ios when having both iOS and Android devices connected at the same time
2 parents 35748f9 + c9e247f commit 5e6ac64

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

commands/device/stop-application.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export class StopApplicationOnDeviceCommand implements ICommand {
1313
private $staticConfig: Config.IStaticConfig,
1414
private $options: IOptions) { }
1515

16-
allowedParameters: ICommandParameter[] = [this.$stringParameter];
16+
allowedParameters: ICommandParameter[] = [this.$stringParameter, this.$stringParameter];
1717

1818
public execute(args: string[]): IFuture<void> {
1919
return (() => {
20-
this.$devicesServices.initialize({ deviceId: this.$options.device, skipInferPlatform: true }).wait();
20+
this.$devicesServices.initialize({ deviceId: this.$options.device, skipInferPlatform: true, platform: args[1] }).wait();
2121

2222
if (this.$devicesServices.deviceCount > 1) {
2323
this.$errors.failWithoutHelp("More than one device found. Specify device explicitly with --device option.To discover device ID, use $%s device command.", this.$staticConfig.CLIENT_NAME.toLowerCase());

mobile/ios/ios-application-manager.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export class IOSApplicationManager implements Mobile.IDeviceApplicationManager {
2121
private $mobileDevice: Mobile.IMobileDevice,
2222
private $logger: ILogger,
2323
private $hostInfo: IHostInfo,
24-
private $staticConfig: IStaticConfig) {
24+
private $staticConfig: IStaticConfig,
25+
private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants) {
2526
this.uninstallApplicationCallbackPtr = CoreTypes.am_device_mount_image_callback.toPointer(IOSApplicationManager.uninstallCallback);
2627
}
2728

@@ -80,7 +81,7 @@ export class IOSApplicationManager implements Mobile.IDeviceApplicationManager {
8081
public restartApplication(applicationId: string): IFuture<void> {
8182
return (() => {
8283
// This must be executed in separate process because ddb sometimes fails and the cli crashes.
83-
this.$childProcess.exec(`${process.argv[0]} ${process.argv[1]} device stop ${applicationId}`).wait();
84+
this.$childProcess.exec(`${process.argv[0]} ${process.argv[1]} device stop ${applicationId} ${this.$devicePlatformsConstants.iOS}`).wait();
8485
this.runApplicationCore(applicationId).wait();
8586
}).future<void>()();
8687
}

0 commit comments

Comments
 (0)