Skip to content

Commit 585f014

Browse files
committed
feat(visionos): ask for the structured log format in debug builds
visionOS devices and simulators already go through the same structured log path as iOS, and the runtime reads logFormat in code shared by both targets.
1 parent 53d3c01 commit 585f014

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎lib/controllers/prepare-controller.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,19 @@ export class PrepareController
525525
version: installedRuntimePackageJSON.version,
526526
};
527527
}
528-
if (prepareData && !prepareData.release) {
529-
packageData.logFormat = IOS_LOG_FORMAT;
530-
}
531528
if (packageData.ios && packageData.ios.discardUncaughtJsExceptions) {
532529
packageData.discardUncaughtJsExceptions =
533530
packageData.ios.discardUncaughtJsExceptions;
534531
}
535532
delete packageData.android;
536533
}
534+
if (
535+
this.$mobileHelper.isApplePlatform(platform) &&
536+
prepareData &&
537+
!prepareData.release
538+
) {
539+
packageData.logFormat = IOS_LOG_FORMAT;
540+
}
537541
if (platform === PlatformTypes.android) {
538542
if (installedRuntimePackageJSON) {
539543
packageData.android = packageData.android || {};

‎test/controllers/prepare-controller.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ describe("prepareController", () => {
200200
assert.equal(rewritten.main, "bundle.123");
201201
});
202202

203-
it("asks for the structured log format in iOS debug builds only", async () => {
203+
it("asks for the structured log format in iOS and visionOS debug builds only", async () => {
204204
assert.equal((await writePackageJson("ios", false)).logFormat, 1);
205+
assert.equal((await writePackageJson("visionos", false)).logFormat, 1);
205206
assert.isUndefined((await writePackageJson("ios", true)).logFormat);
207+
assert.isUndefined((await writePackageJson("visionos", true)).logFormat);
206208
assert.isUndefined((await writePackageJson("android", false)).logFormat);
207209
});
208210
});

0 commit comments

Comments
 (0)