fix: use lipo -info instead of file for architecture detection #2478
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.
Summary:
This PR updates the
verifyApplicationPlatform
function to uselipo -info
instead of thefile
command for determining the architectures supported by the app’s executable. The change improves accuracy when verifying compatibility on both Intel and Apple Silicon devices by aligning with the consistent output format of lipo.Reasoning:
• Inconsistent file Output: The file command’s output can vary based on the system, leading to unreliable architecture detection.
• Consistent lipo Output: lipo -info provides consistent architecture details, which makes it a better choice for ensuring the correct Simulator architecture is detected.
• Simplified Logic: This change also simplifies string matching and error handling, reducing potential issues with cross-architecture setups.
Example of inconsistent file Output
Example of consistent lipo Output