Fix Intel Mac binary not found: afterPack copies wrong arch binaries in cross-arch builds#73
Draft
Fix Intel Mac binary not found: afterPack copies wrong arch binaries in cross-arch builds#73
Conversation
… Mac binary not found Agent-Logs-Url: https://github.com/modstart-lib/linkandroid/sessions/8a7ddead-8b22-4a7d-aedc-a0f4445d22c6 Co-authored-by: modstart <78841409+modstart@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix recent issue reported by users
Fix Intel Mac binary not found: afterPack copies wrong arch binaries in cross-arch builds
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building both
x64andarm64targets on an ARM64 Mac, theafterPackhook used the build machine's arch instead of the target arch, causing the x64 (Intel) app bundle to receiveosx-arm64binaries at the wrong path — leavingosx-x86/scrcpy/adbabsent and crashing on launch.Changes
scripts/build_optimize.cjs: Replacecommon.platformArch()with a newarchFromContext()helper that maps electron-builder'scontext.archenum to the directory naming convention used inelectron/resources/extra/:afterPacknow resolves the correct source directory per target arch, so an ARM64 machine building both slices copiesosx-x86into the x64 bundle andosx-arm64into the arm64 bundle as intended.