From 993aa3a13fe257a636293b78aa5fa757601dcc09 Mon Sep 17 00:00:00 2001 From: Sergei Guselnikov Date: Wed, 9 Oct 2024 06:32:31 +0000 Subject: [PATCH] fix: use lipo -info instead of file for architecture detection (#2478) --- lib/app-utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app-utils.js b/lib/app-utils.js index ea9a6b25e..f4f42de3f 100644 --- a/lib/app-utils.js +++ b/lib/app-utils.js @@ -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); @@ -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 ` +