This is for Xcode 4.5.x iOS armv7 armv7s and the sim and specifcially about Xcode project setup / project build setup:
I have a project "A" that is an app in the app store. I have a project "B" that is a library that will be used in A as a dependency, but also distributed as a 3rd-party library to other companies to use in their apps. (other companies' 3rd party apps are represented in this case as "Y").
Here are the requirements:
UPDATE:
* MOST IMPORTANT: This needs to be a repo I can check out that is a full end-to-end template of what am looking for, and I need to be able to open up Xcode 4.5.2+ and click play and see this thing build, pain-free.
500 points to anyone who can provide me a template project that demonstrates everything I have described above, "A", "B", and "Y" (with "B" static lib used as a dep). All i need is a set of skeleton projects ("A", "B" (nested inside "A"), and "Y") that shows how this can be done. Please don't hold back the answer until the bounty is posted. If it meets my requirements, I'll make sure you get my bounty points.
I'm somewhat worried that with the limitations of Xcode that this is not even possible in a way that is not a complete hassle. Please prove me wrong.
UPDATE: I decided I don't care about armv6 anymore. Goodbye, armv6.
Extra credit if you can get armv6 rolled into the dist output along with armv7, armv7s, i386/simulator.
P.S. I promise that I will be reasonable awarding the points. I'm not looking to withhold them on a technicality. If you make my life dramatically less painful in this one area, I will gladly award you the points.
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.
The Xcode debugger provides several methods to step through your code and inspect variables. You can precisely control execution of your code from a breakpoint, stepping into and out of called functions as necessary to determine where your bug occurs.
This will not be possible in Xcode alone. You will need some build Scripts (which you can call from within Xcode of course) because of the compilation target switch (simulator, device, etc.).
I think you will have to add additional distribution headers to a "Copy files" build step at least. But other modifications should not be necessary if you change something.
I did something like this for libturbojpeg, see https://github.com/dunkelstern/libturbojpeg-ios for reference. It currently puts a fat library into "lib" if you call the "build.sh" file from the terminal, but omits distribution headers. In the case of libturbojpeg I needed 2 project files because each target compiles a different subset of assembler files into the library (better do not look at the assembler makefile stuff). To compile you will need a recent version of NASM as the version apple ships is ancient (get it with brew). I will post a template for such a library build project on the same account shortly. (Will edit or comment if done here with appropriate links)
Basically it works like this:
xcodebuild
for each needed platform targetlipo
You can then distribute the output dir with the copied header files and the lipo
merged universal library and use the library normally as subproject in your workspace as you would do normally (it builds and links only the needed libs then, not the universal lib but that should be no problem)
This does not in fact solve the problem of creating DSYM files for the library. But normally the debugging symbols should be in the library itself when building a debug build. It will strip the debugging symbols on release build and you will have no DSYM then.
Link to example project: https://github.com/dunkelstern/StaticLibraryTemplate
I'm using https://github.com/jverkoey/iOS-Framework to achieve something quite similar to your needs. Give him all the credit, I'm just summarizing how I do it.
Create a static library as usual plus these tweaks:
${PROJECT_NAME}/Headers
prepare_framework.sh
.You can use the static library project in your app: drag it to your app project, add the .a
library as dependency and link with it. You can debug the library along with your app, step into methods, navigate to symbol definitions, etc.
The prepared framework will be used to distribute a binary version:
In the same static library project add an Aggregate target:
build_framework.sh
.The script guess what's the other platform and use xcodebuild
to compile it. Then use lipo
to create a fat binary with all the architectures. The destination of the fat static library will be the framework tree we created before. The final framework is copied to the products folder in the build folder.
With this approach you can:
Feel free to clone a project using this technique to package the library: json-framework fork. I have modified slightly the scripts, check my fork of iOS-framework.
Regarding armv6
, I guess you need and old iOS SDK 4.3 and add manually the literal armv6
to the list of valid architectures and actual architectures. I don't have and old SDK to test it right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With