Skip to content

Commit bbb411a

Browse files
authored
cherrypick(release-1.7): fix(webkit): properly detect arm64 on apple silicon (#4796)
PR #4783 SHA ff2a1f1
1 parent 883ed59 commit bbb411a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/utils/browserPaths.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ export const hostPlatform = ((): BrowserPlatform => {
3535
const macVersion = execSync('sw_vers -productVersion', {
3636
stdio: ['ignore', 'pipe', 'ignore']
3737
}).toString('utf8').trim().split('.').slice(0, 2).join('.');
38-
const archSuffix = os.arch() === 'arm64' ? '-arm64' : '';
38+
let arm64 = false;
39+
if (!macVersion.startsWith('10.')) {
40+
arm64 = execSync('sysctl -in hw.optional.arm64', {
41+
stdio: ['ignore', 'pipe', 'ignore']
42+
}).toString().trim() === '1';
43+
}
44+
const archSuffix = arm64 ? '-arm64' : '';
3945
return `mac${macVersion}${archSuffix}` as BrowserPlatform;
4046
}
4147
if (platform === 'linux') {

0 commit comments

Comments
 (0)