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

Commit 37910d4

Browse files
fix(logs): Logs from iOS device are not shown on Windows
When cloud build is used and iOS device does not have Developer Disk Image mounted, the logs are not visible. The problem is that the code fails to start/stop the application before starting the device log streams. Fix this by starting the logs before trying to start/stop the application.
1 parent f325d78 commit 37910d4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mobile/ios/device/ios-application-manager.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ export class IOSApplicationManager extends ApplicationManagerBase {
7575
}
7676

7777
public async startApplication(appData: Mobile.IApplicationData): Promise<void> {
78-
7978
if (!await this.isApplicationInstalled(appData.appId)) {
8079
this.$errors.failWithoutHelp("Invalid application id: %s. All available application ids are: %s%s ", appData.appId, EOL, this.applicationsLiveSyncInfos.join(EOL));
8180
}
8281

82+
await this.setDeviceLogData(appData);
8383
await this.runApplicationCore(appData);
8484

8585
this.$logger.info(`Successfully run application ${appData.appId} on device with ID ${this.device.deviceInfo.identifier}.`);
@@ -100,7 +100,7 @@ export class IOSApplicationManager extends ApplicationManagerBase {
100100

101101
public async restartApplication(appData: Mobile.IApplicationData): Promise<void> {
102102
try {
103-
this.$deviceLogProvider.setProjectNameForDevice(this.device.deviceInfo.identifier, appData.projectName);
103+
await this.setDeviceLogData(appData);
104104
await this.stopApplication(appData);
105105
await this.runApplicationCore(appData);
106106
} catch (err) {
@@ -109,14 +109,17 @@ export class IOSApplicationManager extends ApplicationManagerBase {
109109
}
110110
}
111111

112-
private async runApplicationCore(appData: Mobile.IApplicationData): Promise<void> {
112+
private async setDeviceLogData(appData: Mobile.IApplicationData): Promise<void> {
113113
this.$deviceLogProvider.setProjectNameForDevice(this.device.deviceInfo.identifier, appData.projectName);
114-
await this.$iosDeviceOperations.start([{ deviceId: this.device.deviceInfo.identifier, appId: appData.appId, ddi: this.$options.ddi }]);
115114
if (!this.$options.justlaunch) {
116115
await this.startDeviceLog();
117116
}
118117
}
119118

119+
private async runApplicationCore(appData: Mobile.IApplicationData): Promise<void> {
120+
await this.$iosDeviceOperations.start([{ deviceId: this.device.deviceInfo.identifier, appId: appData.appId, ddi: this.$options.ddi }]);
121+
}
122+
120123
@cache()
121124
private async startDeviceLog(): Promise<void> {
122125
await this.device.openDeviceLogStream();

0 commit comments

Comments
 (0)