Xcode 7 introduces Bitcode, which is some sort of LLVM intermediate binary that means Apple's servers can recompile my app for different architectures without my involvement.
At Lookback, I distribute a static archive framework with our library. It seems that when you build with anything but a "Build & Archive", bitcode is not actually emitted into my library, and anyone who links with my library in their app and tries to do a Build & Archive with Bitcode enabled will get one of two warnings:
ld: 'Lookback(Lookback.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. (if lib is built with Xcode 6)
ld: warning: full bitcode bundle could not be generated because 'Lookback(Lookback.o)' was built only with bitcode marker. The library must be generated from Xcode archive build with bitcode enabled (Xcode setting ENABLE_BITCODE) (if lib is built with Xcode 7 with a normal xcodebuild)
I have a build script that builds a device+simulator universal binary, so I can't use Build & Archive, but rather, I run xcodebuild from commandline from my script. How can I make xcodebuild generate a proper bitcode-enabled library?
Bitcode is a compile-time feature (not a link-time feature) which means that every .o file should contain an extra section called __bitcode when built with bitcode. You can confirm whether your binary is bitcode-compatible by running otool -l (my .o or .a file) | grep __LLVM.
When you build normally, Xcode adds the build flag -fembed-bitcode-marker to any clang invocation. This seems to be some sort of 'this is where bitcode would go, if bitcode was enabled' thing, and doesn't actually enable bitcode.
When you "Build & Archive", this flag is replaced by -fembed-bitcode, which really does build a Bitcode-enabled binary.
There seems to be two ways to make xcodebuild use -fembed-bitcode:
Use the 'archive' action, as in xcodebuild -target LookbackSDK archive instead of xcodebuild -target LookbackSDK build. This has the side-effect of putting binaries in your Xcode Organizer instead of the build/ folder, though you can work around that by using -exportArchive -archivePath ./build (thanks #JensAyton)
Force usage of the flag by adding Other C Flags with OTHER_CFLAGS="-fembed-bitcode". Your xcodebuild invocation would look something like xcodebuild OTHER_CFLAGS="-fembed-bitcode" -target LookbackSDK build.
The latter is what I chose so that I don't have to change my build system, but it will generate warnings for every file, since now both -fembed-bitcode-marker and -fembed-bitcode are sent to clang. Luckilly the latter wins, generating a Bitcode-enabled library!
Resources
Apple DevForums: Bitcode and Assembly?
SO: iOS library to BitCode
With Xcode 8, I couldn't get OTHER_CFLAGS="-fembed-bitcode" to work. I kept running into something along the lines of was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build when I tried to create an Archive build of an app containing my static framework.
What I was really looking for was this:
BITCODE_GENERATION_MODE=bitcode
I'm actually using a Run Script inside of an aggregate target, the full xcodebuild line looks like this (just for reference):
xcodebuild BITCODE_GENERATION_MODE=bitcode OTHER_CFLAGS="-fembed-bitcode" -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
Once you add bitcode support for the static lib, it won't be compatible with Xcode 6. The app won't archive.
I would like to clearly mention the setting for bitcode as #nevyn's answer confused me a little.
Go to Build settings, search for "custom compiler flags". Add -fembed-bitcode. This will build your lib with bitcode.
Select project
On Build Settings -> Other C flags, set Debug to -fembed-bitcode-marker and Release to -fembed-bitcode
On Build Settings, click on the + sign at the top to add a user-defined build setting with the name BITCODE_GENERATION_MODE, and set Debug to marker, Release to bitcode
Edit schema as Release
Then click the desired library. A file and get the build path.
Get the library form Release folder.
Related
im using xcode 13.2.1, MacOs Monterey version 12.2 (M1).
Im trying to compile my app with bitcode using xcode.
I have Bitcode-Enable = yes in both project and target.
I checked the build log and I have no warning stating I am using a framework/library that isn't compiled with bitcode so that's not the issue.
I archived the app and I also made sure to check the rebuild with bitcode option.
When I run the command otool -l my-cool-app } | grep LLVM it shows nothing (No bitcode section). What am I possibly doing wrong?
forgot to update, apparently Bitcode-Enable = yes is not enough.
you need to specify the correct flag to compile the bitcode.
this is the command line I used:
xcodebuild BITCODE_GENERATION_MODE=bitcode OTHER_CFLAGS="-fembed-bitcode" -target "${PROJECT_NAME}"
I have a framework project and I'm trying to build a fat file (iphoneos + iphonesimulator) using a script build phase, but it's not working. The script is simple; it checks the platform being currently built, like to:
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]
then
SF_OTHER_PLATFORM=iphonesimulator
else
SF_OTHER_PLATFORM=iphoneos
fi
And then uses xcodebuild to build it:
xcrun xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -sdk ${SF_OTHER_PLATFORM} -configuration "${CONFIGURATION}" BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}" $ACTION
Other details on the script have been omited for simplicity.
If I chose the initial target as the simulator, this works fine, and both the simulator and device binaries are generated and I use lipo to get the fat file. The problem happens when I do it the other way around, and build the device file, and as such xcodebuild is called for the iphonesimulator SDK. The build fails with the following error:
CodeSign error: entitlements are required for product type 'Framework' in SDK 'Simulator - iOS 8.4'. Your Xcode installation may be damaged.
If I change the -sdk option I get the build, but not the simulator build, which is what I need. This would be (kinda) fine, but in order to build for release (Archive) I need to set the device as the primary target, or otherwise xcode doesn't give me the option.
What should I do?
It looks like you need to put your script in an aggregate target type. It was designed for exactly such cases: two different targets in one build.
What I do is create a new target (Other->Aggregate type) and add a script to it and use that target to create a fat release product.
Here's the script I'm using:
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -sdk iphonesimulator -configuration Release
xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -sdk iphoneos -configuration Release
mkdir -p ${TARGET_BUILD_DIR}/../MyApp${CURRENT_PROJECT_VERSION}
cp -r ${TARGET_BUILD_DIR}/../Release-iphoneos/ ${TARGET_BUILD_DIR}/../MyApp${CURRENT_PROJECT_VERSION}
lipo -create "${TARGET_BUILD_DIR}/../Release-iphoneos/MyApp.framework/MyApp" "${TARGET_BUILD_DIR}/../Release-iphonesimulator/MyApp.framework/MyApp" -output "${TARGET_BUILD_DIR}/../MyApp${CURRENT_PROJECT_VERSION}/MyApp.framework/MyApp"
Works like a charm. It creates a folder with the version number (you set it in your new target) and a fat framework inside.
EDIT:
Why this didn't work for you.
Developer is free to distribute iOS framework without codesigning it
as Consumer will re-codesign it anyway, but Developer is forced by
Xcode to codesign his framework when he builds for iOS device.
Creating iOS/OSX Frameworks: is it necessary to codesign them before distributing to other developers?
When you're using the device target you're forced to code sign even if you don't have to. That's why it works with the aggregate target -> it's not expected of you to codesign and you don't need to codesign to release a framework.
Selecting the simulator, the process works fine because you are building using the Debug configuration I think.
In the Project navigator, select your project. Now select your target and under the Build Settings tab, check Code Signing Identity settings.
If you expand that, you should see a row for every configuration you set in your project (if you didn't, you should see the default Debug and Release rows).
Now check under the Release row (that is the default used when the Archive command is called) that is set the correct identity (this is based on what you selected under Provisioning Profile).
If you want to know more about provisioning profiles, signing identity and so on, check this link from Apple
I have an iOS project that has iOS 6.0 as a deployment target. It builds fine both under Xcode and xcodebuilder (necessary for CI). However the client now wants the project to only be available for users who have iOS7+ installed.
No problem, I'll just increase the deployment target number right? Wrong!
Under Xcode the project continues to compile just fine. Under xcodebuild however, the project fails to compile with lots of errors like this:
Undefined symbols for architecture armv7:
"std::string::_Rep::_S_empty_rep_storage", referenced from:
in drmNativeInterface
It's using Adobe Primetime and drmNativeInterface is part of that.
To help isolate the problem I've created a brand new, single-screen project and performed the following changes:
Added the drmNativeInterface framework and the two Apple-supplied dependencies that are required for the project to build in Xcode, MediaPlayer and AVFoundation to "Link Binary with Libraries". The Primetime documentation lists other dependencies as well but it makes no difference if I add those - these are the only 2 that are needed for a successful build under Xcode.
Replaced the valid archs "arm64 armv7 armv7s" with "armv6 armv7 armv7s" (even though drmNativeInterface apparently contains i386, x86_64, armv7s and arm64 slices, even Xcode won't compile the project unless I switch arm64 for armv6).
Set "Build Active Architecture Only" to NO for both configurations.
And finally, added "-lstdc++ -ObjC -all_load" to "Other Linker Flags".
Other than those few steps above, the project is stock single-screen: no code has been added.
Xcode will compile it but xcodebuild will not. For xcodebuild to compile it I have to switch the deployment target to 6.0 which defeats the client's request.
The CI xcodebuild command contains a few params but here's the minimised command I'm using for this test project:
xcodebuild -project "MyProject.xcodeproj" -scheme "MyProject"
I've tried adding FRAMEWORK_SEARCH_PATHS, HEADER_SEARCH_PATHS and ALWAYS_SEARCH_USER_PATHS params in case xcodebuild was simply unable to use the paths contained within the project file but that made no difference.
If I remove the drmNativeInterface framework from the project - leaving the 2 Apple-based dependencies alone - the project compiles just fine for both Xcode and xcodebuild. But obviously this isn't a solution because I need that framework!
Does anyone have any idea what could be causing this or how to fix it?
**NB: **
There are a lot of questions on SO where projects will build in Xcode and not in xcodebuilder, but I couldn't find any where a project will build in xcodebuilder just fine for one deployment target and not for another.
Thanks in advance.
Linking the libstdc++ library (in this case, libstdc++6.dylib to be exact) fixed the problem.
You lose the libstdc++6.dylib in Link Binary With Libraries
Just add it like :
With Xcode 6 we get ability to create own Dynamic Cocoa Frameworks.
Because of:
Simulator still use 32-bit library
beginning June 1, 2015 app updates submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK (developer.apple.com)
We have to make fat library to run project on devices and simulators. i.e. support both 32 and 64 bit in Frameworks.
But I didn't find any manuals, how to export universal fat Framework for future integration with other projects (and share this library with someone).
Here is my steps to reproduce:
Set ONLY_ACTIVE_ARCH=NO in the Build Settings
Add support armv7 armv7s arm64 i386 x86_64 to Architectures (for sure)
Build Framework and open it in Finder:
Add this framework to another project
Actual result:
But in the end I still have problem with running project with this framework on devices and simulator at once.
if I take framework from Debug-iphoneos folder - it works on devices
and gets error on simulators: ld: symbol(s) not found for architecture i386
xcrun lipo -info CoreActionSheetPicker
Architectures in the fat file: CoreActionSheetPicker are: armv7 armv7s arm64
if I take framework from Debug-iphonesimulator folder - it works on simulators. and I have error on device: ld: symbol(s) not found for architecture arm64
xcrun lipo -info CoreActionSheetPicker
Architectures in the fat file: CoreActionSheetPicker are: i386 x86_64
So, how to create a dynamic framework that works on devices and simulators?
This answer related to Xcode 6 iOS Creating a Cocoa Touch Framework - Architectures issues but it's not duplicate.
Update:
I found a "dirty hack" for this case. See my answer below.
If someone knows more convenient way - please, let me know!
The actuality of this answer is: July 2015. It is most likely that things will change.
TLDR;
Currently Xcode does not have tools for automatic export of universal fat framework so developer must resort to manual usage of lipo tool. Also according to this radar before submission to AppStore developer who is framework's consumer also must use lipo to strip off simulator slices from a framework.
Longer answer follows
I did similar research in the topic (the link at the bottom of the answer).
I had not found any official documentation about distribution of so my research was based on exploration of Apple Developer Forums, Carthage and Realm projects and my own experiments with xcodebuild, lipo, codesign tools.
Here's long quote (with a bit of markup from me) from Apple Developer Forums thread Exporting app with embedded framework:
What is the proper way to export a framework from a framework project?
Currently the only way is exactly what you have done:
Build the target for both simulator and iOS device.
Navigate to Xcode's DerivedData folder for that project and lipo the two binaries together into one single framework. However, when you build the framework target in Xcode, make sure to adjust the target setting 'Build Active Architecture Only' to 'NO'. This will allow Xcode to build the target for multiple binarty types (arm64, armv7, etc). This would be why it works from Xcode but not as a standalone binary.
Also you'll want to make sure the scheme is set to a Release build and build the framework target against release.
If you are still getting a library not loaded error, check the code slices in the framework.
Use lipo -info MyFramworkBinary and examine the result.
lipo -info MyFrameworkBinary
Result is i386 x86_64 armv7 arm64
Modern universal frameworks will include 4 slices, but could include more: i386 x86_64 armv7 arm64
If you don't see at least this 4 it coud be because of the Build Active Architecture setting.
This describes process pretty much the same as #skywinder did it in his answer.
This is how Carthage uses lipo and Realm uses lipo.
IMPORTANT DETAIL
There is radar: Xcode 6.1.1 & 6.2: iOS frameworks containing simulator slices can't be submitted to the App Store and a long discussion around it on Realm#1163 and Carthage#188 which ended in special workaround:
before submission to AppStore iOS framework binaries must be stripped off back from simulator slices
Carthage has special code: CopyFrameworks and corresponding piece of documentation:
This script works around an App Store submission bug triggered by universal binaries.
Realm has special script: strip-frameworks.sh and corresponding piece of documentation:
This step is required to work around an App Store submission bug when archiving universal binaries.
Also there is good article: Stripping Unwanted Architectures From Dynamic Libraries In Xcode.
I myself used Realm's strip-frameworks.sh which worked for me perfectly without any modifications though of course anyone is free to write a one from scratch.
The link to my topic which I recommend to read because it contains another aspect of this question: code signing - Creating iOS/OSX Frameworks: is it necessary to codesign them before distributing to other developers?
This is not so clear solution, but there is only way, that I find:
Set ONLY_ACTIVE_ARCH=NO in the Build Settings
Build library for simulator
Build library for device
Open in console Products folder for your framework (you can open it by open framework folder and cd .. from there)
Run this script from Products folder. It creates fat Framework in this folder. (or do it manually as explained below in 3. 4.)
Or:
Combine these 2 Frameworks using lipo by this script (replace YourFrameworkName to your Framework name)
lipo -create -output "YourFrameworkName" "Debug-iphonesimulator/YourFrameworkName.framework/YourFrameworkName" "Debug-iphoneos/YourFrameworkName.framework/YourFrameworkName"
Replace with new binary one of the existing frameworks:
cp -R Debug-iphoneos/YourFrameworkName.framework ./YourFrameworkName.framework
mv YourFrameworkName ./YourFrameworkName.framework/YourFrameworkName
Profit: ./YourFrameworkName.framework - is ready-to-use fat binary! You can import it to your project!
For project, that not in Workspaces:
You can also try to use this gist as described here. But it seems, that it not works for projects in workspaces.
#Stainlav answer was very helpful but what I did instead was to compile two versions of the framework (one for the device and one for simulator) and then added the following Run Script Phase to automatically copy the precompiled framework required for the running architecture
echo "Copying frameworks for architecture: $CURRENT_ARCH"
if [ "${CURRENT_ARCH}" = "x86_64" ] || [ "${CURRENT_ARCH}" = "i386" ]; then
cp -af "${SRCROOT}/Frameworks/Simulator/." "${SRCROOT}/Frameworks/Active"
else
cp -af "${SRCROOT}/Frameworks/Device/." "${SRCROOT}/Frameworks/Active"
fi
This way I don't have use lipo to create a fat framework neither the Realm's strip-frameworks.sh to remove the unnecessary slices when submitting to the App Store.
basically for this i found very good solution. you just need to follow these simple steps.
Create a cocoa touch framework.
Set bitcode enabled to No.
Select your target and choose edit schemes. Select Run and choose Release from Info tab.
No other setting required.
Now build the framework for any simulator as simulator runs on x86 architecture.
Click on Products group in Project Navigator and find the .framework file.
Right click on it and click on Show in finder. Copy and paste it in any folder, I personally prefer the name 'simulator'.
Now build the framework for Generic iOS Device and follow the steps 6 through 9. Just rename the folder to 'device' instead of 'simulator'.
Copy the device .framework file and paste in any other directory. I prefer the immediate super directory of both.
So the directory structure now becomes:
Desktop
device
MyFramework.framework
simulator
MyFramework.framework
MyFramework.framework
Now open terminal and cd to the Desktop. Now start typing the following command:
lipo -create 'device/MyFramework.framework/MyFramework'
'simulator/MyFramework.framework/MyFramework' -output
'MyFramework.framework/MyFramework'
and that's it. Here we merge the simulator and device version of MyFramework binary present inside MyFramework.framework. We get a universal framework that builds for all the architectures including simulator and device.
My Answer cover the below points:
Make framework which works for both simulator and Device
How to export “fat” Cocoa Touch Framework (for Simulator and Device both)?
Undefined symbols for architecture x86_64
ld: symbol(s) not found for architecture x86_64
Steps 1: First build your frameworks with Simulator target
Steps 2: After success of simulator building process, now build for your framework with device target selection or Generic iOS Device selection
Step 3: Now select your framework target and for that Under "Build Phases" select "Add Run Script" and copy the below script code)
Step4: Now finally, build again and your framework is ready for both simulator and device compatibility. Hurray!!!!
[Note: We must have both compatible framework ready before final step4 (simulator and device architecture compatible, if not please follow above steps 1 and 2 correctly)
See the reference image:
Put below code into shell area:
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
# Step 2. Copy the framework structure (from iphoneos build) to the universal folder
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"
# Step 3. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory
SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/."
if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then
cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"
fi
# Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"
# Step 5. Convenience step to copy the framework to the project's directory
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
# Step 6. Convenience step to open the project's directory in Finder
open "${BUILD_DIR}/${CONFIGURATION}-universal"
I just want to update this great answer by #odm. Since Xcode 10, the CURRENT_ARCH variable doesn't reflect the build architecture anymore. So I changed the script to check the platform instead:
echo "Copying frameworks for platform: $PLATFORM_NAME"
rm -R "${SRCROOT}/Frameworks/Active"
if [ "${PLATFORM_NAME}" = "iphonesimulator" ]; then
cp -af "${SRCROOT}/Frameworks/Simulator/." "${SRCROOT}/Frameworks/Active"
else
cp -af "${SRCROOT}/Frameworks/Device/." "${SRCROOT}/Frameworks/Active"
fi
I also added a line to clear the target directory before copying, because I noticed that additional files in subdirectories wouldn't be overwritten otherwise.
A lot of iOS 3rd Party frameworks are built around custom frameworks, that you are going to integrate in your dependent app.
Before the new iOS Embedded Framework that only works in iOS8 (see my post here), there were two elegant solution for that (when you do not choose to create your scripts for a matter of time and knowledge on that)
The iOS Universal Framework by kstenerud
and
The iOS Framework by jverkoey
They both worked and were good solution when have to create a .framework to distribute a solution for your clients.
As soon as Xcode6 came out, I was not able to make the first to work due to compilation errors of different kind (see here for details).
So I moved to the iOS Framework, and with my surprise it still works on XCode6.
So this advice is for the ones that are struggling with iOS Universal Framework and do not find any solution to make it works on Xcode6.
Since as depicted in 1 there is now way for Apple to accept Embedded Frameworks if your deployment target is >= iOS7, this is the best custom solution at the moment, and a fix for the iOS Universal Framework could help as well.
All the issues I have found on it are depicted in 5.
Here step to create static cocoa touch framework in Xcode 6.
Open Xcode and create a new static framework project by clicking File\New\Project and selecting iOS\Framework and Library\Cocoa Touch framework.
You can provide your framework name and save the project to an empty directory.
Automatically umbrella header created for our framework. In this header , you should import all the public headers of our framework using the statements like #import
A static framework project is made up of header files and implementation files, which are compiled to make the framework itself. You can create the class by using the Cocoa Touch class.
Verifying Your Build Settings Go to the Build Settings of your project Target and confirm or set the “Architectures” to “Standard Architectures.” These are arm64 and armv7, and are likely the default. As well as, Also we need to set the few architectures in setting, because iOS apps need to run on many different architectures.
armv7: Used in the oldest iOS 7-supporting devices armv7s: As used in iPhone 5 and 5C arm64: For the 64-bit ARM processor in iPhone 5S i386: For the 32-bit simulator x86_64: Used in 64-bit simulator
This means that builds are as fast as they can be. When you archive an app or build in release mode, then Xcode will build for all ARM architectures, thus allowing the app to run on most devices.
Mach-O setting: Static library:
Final Build project:
Aggregate target to combine the device and simulator framework by using lipo, you can add the below script to your aggregate target.
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework"
UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal"
FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"
xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphonesimulator -arch i386 -arch x86_64 -target ${PROJECT_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator | echo
xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphoneos -arch arm64 -arch armv7 -arch armv7s -target ${PROJECT_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphoneos | echo
rm -rf "${UNIVERSAL_LIBRARY_DIR}"
mkdir "${UNIVERSAL_LIBRARY_DIR}"
mkdir "${FRAMEWORK}"
cp -r "${DEVICE_LIBRARY_PATH}/." "${FRAMEWORK}"
lipo "${SIMULATOR_LIBRARY_PATH}/${FRAMEWORK_NAME}""${DEVICE_LIBRARY_PATH}/${FRAMEWORK_NAME}" -create -output"${FRAMEWORK}/${FRAMEWORK_NAME}" | echo
You can use Xcode 6 Universal Framework in iOS 7, - see my answer here