Skip to content

Instantly share code, notes, and snippets.

@hendych
Last active January 26, 2022 06:36
Show Gist options
  • Save hendych/94a9a444522571a2c08e4bb551d9fa0f to your computer and use it in GitHub Desktop.
Save hendych/94a9a444522571a2c08e4bb551d9fa0f to your computer and use it in GitHub Desktop.
convert lib arm64 built for iOS devices to arm64 simulator
# In older arm64 architecture, xcode will build the library for iPhone devices.
# We need to change LC_VERSION_MIN_IPHONEOS to IOSSIMULATOR in the library linking command.
# You can check if the arm64 arch support simulator or not by running this command below:
# otool -l -arch arm64 lib.a
# We can create xcframework manually by creating folder with extension .xcframework,
# then inside the dir, we can create ios-arm64 and ios-arm64_x86_64-simulator folder with each contains framework
# or library that we want to link.
#
# But first we can remove the unused arch using this command
# lipo -remove <armv7/i386/x86_64> iOS/SDK.framework/SDK -output SDK
# Next, convert the remaining arm64 architecture from LC_VERSION_MIN_IPHONEOS to IOSSIMULATOR:
# https://github.com/hendych/arm64-to-sim/blob/main/Sources/arm64-to-sim/main.swift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment