Skip to content

Instantly share code, notes, and snippets.

@seanbollin
Created February 1, 2014 09:43
Show Gist options
  • Save seanbollin/8750160 to your computer and use it in GitHub Desktop.
Save seanbollin/8750160 to your computer and use it in GitHub Desktop.
Build universal library for XCode device and simulator
CC=clang
IPHONEOS_DEPLOYMENT_TARGET=7.0
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
CFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -mios-simulator-version-min=7.0"
CC=clang
IPHONEOS_DEPLOYMENT_TARGET=7.0
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
CFLAGS="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=7.0" --host=armv7
lipo -create "your armv7 lib".a "your simulator lib".a -output "your lib".a
lipo -create "your armv7 lib".dylib "your simulator lib".dylib -output "your lib".dylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment