Skip to content

Commit 672be49

Browse files
Fix run on multiple devices
When multiple devices with same platform are attached, `tns run <platform>` command should start the app on all of them. Currently the application is started, but the call to commandsService (device|run) command is failing as more than one device is attached. Fix this by calling the correct method from the devicesService.
1 parent cb055ae commit 672be49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/services/platform-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ export class PlatformService implements IPlatformService {
348348
public deployOnDevice(platform: string, buildConfig?: IBuildConfig): IFuture<void> {
349349
return (() => {
350350
this.installOnDevice(platform, buildConfig).wait();
351-
this.$commandsService.tryExecuteCommand("device", ["run", this.$projectData.projectId]).wait();
351+
let action = (device: Mobile.IDevice) => device.applicationManager.startApplication(this.$projectData.projectId);
352+
this.$devicesService.execute(action).wait();
352353
}).future<void>()();
353354
}
354355

0 commit comments

Comments
 (0)