Skip to content

Commit 541d5cb

Browse files
Fatme HavaluovaFatme Havaluova
authored andcommitted
Call ensurePlatformInstalled from livesync-service
1 parent 8e72b52 commit 541d5cb

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/definitions/platform.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface IPlatformService {
1818
getLatestApplicationPackageForDevice(platformData: IPlatformData): IFuture<IApplicationPackage>;
1919
getLatestApplicationPackageForEmulator(platformData: IPlatformData): IFuture<IApplicationPackage>;
2020
copyLastOutput(platform: string, targetPath: string, settings: {isForDevice: boolean}): IFuture<void>;
21+
ensurePlatformInstalled(platform: string): IFuture<void>;
2122
}
2223

2324
interface IPlatformData {

lib/services/platform-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ export class PlatformService implements IPlatformService {
417417
}).future<void>()();
418418
}
419419

420-
private ensurePlatformInstalled(platform: string): IFuture<void> {
420+
public ensurePlatformInstalled(platform: string): IFuture<void> {
421421
return (() => {
422422
if(!this.isPlatformInstalled(platform).wait()) {
423423
this.addPlatform(platform).wait();

lib/services/usb-livesync-service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncSer
4444
return (() => {
4545
platform = platform || this.initialize(platform).wait();
4646
let platformLowerCase = platform ? platform.toLowerCase() : null;
47+
48+
this.$platformService.ensurePlatformInstalled(platform).wait();
49+
4750
let platformData = this.$platformsData.getPlatformData(platformLowerCase);
4851

4952
if (platformLowerCase === this.$devicePlatformsConstants.Android.toLowerCase()) {

0 commit comments

Comments
 (0)