iOS fat static library & submission - ios

I have an iOS fat static library (iphoneos & iphonesimulator), if I was to use this during an app submission would it fail on the grounds that the binary includes iphonesimulator code?

I think there is no problem. When you link your app for device it simply embed the code for the architecture your are using. So your app compiled for device does not embed code for simulator.

Related

In Xcode, how to build an Objective-C lib for an app to run on iOS SIMULATOR?

We get the error below when we try to build an app that uses our Obj-C lib.
What do we set in the lib project to prevent this error?
Ultimately, app must run on iPhone (ios 12 or higher), but we want it to first run on simulator.
Building for iOS Simulator, but the linked library 'libmobile_sys_hub_lib.a' was built for iOS.
That means you built the library for iOS. You need to build it for the iOS Simulator. Eg:
xcodebuild -sdk iphonesimulator
You will probably want to distribute separate copies of your library: one for the sim and one for device.
Open Xcode active scheme list (left side of project title bar) and select IOS SIMULATOR

Reduce ipa file size

Lets say I have 3rd part universal(contains symbols for both iPhone and Simulator) iOS framework: A.framewwork.
How Can I reduce final ipa file(for physical device) by removing unnecessary Simulator symbols from framework? Is XCode have such settings for linker?
Any help will be appreciated.
Ask third party vender to get only amrv7s/armv_64 framework

Linking to Google APIs Objective-C Client Library as iOS static library

I have so far used Google APIs Client Library for Objective-C by compiling the source files directly into my app (as described here). If I were to switch over to linking to the iOS static library (as also described here), how would this insure that the code works on different architectures?
For instance, if I follow the verbatim instruction I have to compile the static library by choosing a schema (GTLTouchStaticLib) and an architecture (e.g. iOS Simulator: iPhone 5). If I choose a simulator as architecture, file libGTLTouchStaticLib.a reports that the archive contains code for architectures i386 and x86_64. If I choose a physical iPhone 5 instead, file reports on architectures armv7 and arm64.
How do I ensure that the libGTLTouchStaticLib.a that I'm going to drag into my application project's Build Phases "Link Binary with Libraries" list (according to Google's instructions) contains all (not just some) of the architectures that might be encountered when my app goes life? I guess armv7 and arm64 is sufficient for an app that requires iOS 8, but I'd like to be sure.)
You have to combine the generated binaries using lipo command line tool.
The following tutorial about creating static library in iOS demonstrates use of lipo under section Universal Binaries

Running iOS SDK built in arm7 on arm7s

I have an SDK to achieve some special stream of video but I've got only the binary of this, I think this was built for arm7.
I have an app built with this library and it runs great on iPhone 4, 4s and iPad 2 but when building for iPad 4th generation with an arm7s xcode shows lots of errors about files being ignored.
I'm pretty sure it's the architecture cause changing the build architecture the errors appear and disappear.
Is there any way to make this work? I mean build for new architectures having only binaries files of the old one?
Unfortunately not. To build your app for armv7s all the code – which includes said library – has to be built for it. There is a hack to add armv7s support to static libraries but I would strongly recommend against using it.
That being said, for now it's not a big deal if you're building your app for armv7 only. It will still work fine on the iPhone 5.
Just go into the build settings of your Target and set "armv7" as the only architecture your app should be built for.
At one point in the future Apple will probably require that all new apps / app updates will be built for armv7s, like the did with armv7 a few years ago, but for now it's not a problem. By then the developer of the static library will hopefully have provided an update.

Distribute iOS static Library

I have compiled 2 static libs of same code-base, one for simulator and one for device. I would like to know, whether should i submitted both libs to Apple.
Or can I create a universal static lib, which can run on both Simulator as well on Device. Is it recommended by Apple to submit only universal library ? How can I produce that ?
Apples don't care about code for iOS simulator and thats shy when you build application for submit, binary for i386 architecture won't be compiled by default and that's correct behavior. Just build for device and submit it, everything will be OK.

Resources