Friday, 18 May 2012
Noatikl 2 now on the Mac App Store
http://itunes.apple.com/us/app/id469613273?mt=12&u1=webmac&affId=1860684
We now have four products on the Mac App Store - Noatikl, Mixtikl, Mixtikl Free and Liptikl - thanks to Apple for providing this distribution channel!
Tuesday, 15 May 2012
XCode and static libraries - auto-archiving the .a files for iOS and Mac
For example, I had builds both for iOS and Simulator, and they were both going somewhere like this:
/Users/me/Library/Developer/Xcode/DerivedData/mylib_blahblahblahblah/Build/Intermediates/... ...ArchiveIntermediates/mylib/IntermediateBuildFilesPath/UninstalledProducts/libmylib.a
... which is a bit tricky to deal with!
The solution for me was to create a Run Script entry in the Build Phases for my Target under the XCode project/target settings...:
mkdir -p /Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME cp -p $TARGET_BUILD_DIR/libmylib.a /Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME if [ $CONFIGURATION eq Release ] then /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -S \ /Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME/libmylib.a fi
Note the strip command, which is essential as the script is always run before XCode's normal strip behaviour!
Note also that to generate a library for Release, for both iOS and simulator, you need to Build for Profile.
Here is the command-line I use to build it all automatically!
xcodebuild -project mylib.xcodeproj Release -sdk iphonesimulator clean xcodebuild -project mylib.xcodeproj Release -sdk iphoneos clean xcodebuild -project mylib.xcodeproj Release -sdk iphonesimulator xcodebuild -project mylib.xcodeproj Release -sdk iphoneos
To configure an app to link-in the appropriate version of the (copied!) static library to match your app's Release/Debug configuration and target (iOS/Simulator), simply put this in the Other Linker Flags section of your app...:
/Users/me/myfolder/$CONFIGURATION-$PLATFORM_NAME/libmylib.a