Skip to content

Commit

Permalink
fix: use lipo -info instead of file for architecture detection (#2478)
Browse files Browse the repository at this point in the history
  • Loading branch information
arietis authored Oct 9, 2024
1 parent 16d92b2 commit 993aa3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/app-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function verifyApplicationPlatform() {

const executablePath = path.resolve(this.opts.app, await this.appInfosCache.extractExecutableName(this.opts.app));
const [resFile, resUname] = await B.all([
exec('file', [executablePath]),
exec('lipo', ['-info', executablePath]),
exec('uname', ['-m']),
]);
const bundleExecutableInfo = _.trim(resFile.stdout);
Expand All @@ -68,8 +68,8 @@ export async function verifyApplicationPlatform() {
// We cannot run Simulator builds compiled for arm64 on Intel machines
// Rosetta allows only to run Intel ones on arm64
if (
!_.includes(bundleExecutableInfo, `executable ${arch}`) &&
!(isAppleSilicon && _.includes(bundleExecutableInfo, 'executable x86_64'))
!_.includes(bundleExecutableInfo, arch) &&
!(isAppleSilicon && _.includes(bundleExecutableInfo, 'x86_64'))
) {
throw new Error(
`The ${this.opts.bundleId} application does not support the ${arch} Simulator ` +
Expand Down

0 comments on commit 993aa3a

Please sign in to comment.