diff --git a/appbuilder/providers/device-app-data-provider.ts b/appbuilder/providers/device-app-data-provider.ts index 891fc2a0..a4ac9bcf 100644 --- a/appbuilder/providers/device-app-data-provider.ts +++ b/appbuilder/providers/device-app-data-provider.ts @@ -102,7 +102,7 @@ export class IOSAppIdentifier extends AppBuilderDeviceAppDataBase implements ILi @cache() public async getDeviceProjectRootPath(): Promise { if (this.device.isEmulator) { - const applicationPath = this.$iOSSimResolver.iOSSim.getApplicationPath(this.device.deviceInfo.identifier, this.appIdentifier); + const applicationPath = await this.$iOSSimResolver.iOSSim.getApplicationPath(this.device.deviceInfo.identifier, this.appIdentifier); return path.join(applicationPath, "www"); } @@ -127,7 +127,7 @@ export class IOSNativeScriptAppIdentifier extends AppBuilderDeviceAppDataBase im @cache() public async getDeviceProjectRootPath(): Promise { if (this.device.isEmulator) { - const applicationPath = this.$iOSSimResolver.iOSSim.getApplicationPath(this.device.deviceInfo.identifier, this.appIdentifier); + const applicationPath = await this.$iOSSimResolver.iOSSim.getApplicationPath(this.device.deviceInfo.identifier, this.appIdentifier); return applicationPath; } diff --git a/definitions/mobile.d.ts b/definitions/mobile.d.ts index 6b22a796..b58038b8 100644 --- a/definitions/mobile.d.ts +++ b/definitions/mobile.d.ts @@ -233,7 +233,7 @@ declare module Mobile { * @param {string} deviceId The unique identifier of the device. * @param {Mobile.IiOSLogStreamOptions} options Describes the options which can be passed */ - startLogProcess(deviceId: string, options?: Mobile.IiOSLogStreamOptions): void; + startLogProcess(deviceId: string, options?: Mobile.IiOSLogStreamOptions): Promise; /** * Starts a new process for getting simulator logs and emits and DEVICE_LOG_EVENT_NAME event. The event's reponse is with muted=true flag so it will not be printed from deviceLogProvider. * @param {string} deviceId The unique identifier of the device. diff --git a/mobile/ios/simulator/ios-simulator-application-manager.ts b/mobile/ios/simulator/ios-simulator-application-manager.ts index b7495275..bf57994a 100644 --- a/mobile/ios/simulator/ios-simulator-application-manager.ts +++ b/mobile/ios/simulator/ios-simulator-application-manager.ts @@ -32,7 +32,7 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase { } } - this.iosSim.installApplication(this.device.deviceInfo.identifier, packageFilePath); + return this.iosSim.installApplication(this.device.deviceInfo.identifier, packageFilePath); } public async uninstallApplication(appIdentifier: string): Promise { @@ -40,7 +40,7 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase { } public async startApplication(appData: Mobile.IApplicationData): Promise { - const launchResult = this.iosSim.startApplication(this.device.deviceInfo.identifier, appData.appId); + const launchResult = await this.iosSim.startApplication(this.device.deviceInfo.identifier, appData.appId); const pid = getPidFromiOSSimulatorLogs(appData.appId, launchResult); await this.setDeviceLogData(appData, pid); } @@ -87,7 +87,7 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase { return null; } - const applicationPath = this.iosSim.getApplicationPath(this.device.deviceInfo.identifier, appIdentifier), + const applicationPath = await this.iosSim.getApplicationPath(this.device.deviceInfo.identifier, appIdentifier), pathToInfoPlist = path.join(applicationPath, "Info.plist"); return this.$fs.exists(pathToInfoPlist) ? await this.$plistParser.parseFile(pathToInfoPlist) : null; diff --git a/mobile/ios/simulator/ios-simulator-device.ts b/mobile/ios/simulator/ios-simulator-device.ts index 6ed0529b..27d6e239 100644 --- a/mobile/ios/simulator/ios-simulator-device.ts +++ b/mobile/ios/simulator/ios-simulator-device.ts @@ -58,7 +58,7 @@ export class IOSSimulator implements Mobile.IiOSSimulator { public async openDeviceLogStream(options?: Mobile.IiOSLogStreamOptions): Promise { this._deviceLogHandler = this.onDeviceLog.bind(this, options); this.$iOSSimulatorLogProvider.on(constants.DEVICE_LOG_EVENT_NAME, this._deviceLogHandler); - this.$iOSSimulatorLogProvider.startLogProcess(this.simulator.id, options); + return this.$iOSSimulatorLogProvider.startLogProcess(this.simulator.id, options); } public detach(): void { diff --git a/mobile/ios/simulator/ios-simulator-log-provider.ts b/mobile/ios/simulator/ios-simulator-log-provider.ts index e975a33b..a9ac9f02 100644 --- a/mobile/ios/simulator/ios-simulator-log-provider.ts +++ b/mobile/ios/simulator/ios-simulator-log-provider.ts @@ -18,9 +18,9 @@ export class IOSSimulatorLogProvider extends EventEmitter implements Mobile.IiOS this.shouldDispose = shouldDispose; } - public startLogProcess(deviceId: string, options?: Mobile.IiOSLogStreamOptions): void { + public async startLogProcess(deviceId: string, options?: Mobile.IiOSLogStreamOptions): Promise { if (!this.simulatorsLoggingEnabled[deviceId]) { - const deviceLogChildProcess: ChildProcess = this.$iOSSimResolver.iOSSim.getDeviceLogProcess(deviceId, options ? options.predicate : null); + const deviceLogChildProcess: ChildProcess = await this.$iOSSimResolver.iOSSim.getDeviceLogProcess(deviceId, options ? options.predicate : null); const action = (data: NodeBuffer | string) => { const message = data.toString();