2 ipa files for same app (for better size and performance) - ios

I'm working on an iOS application which is developed for all devices (retina and non-retina)
The size of the app is too big now to have compromise for all devices. (Why should iphone 3gs suffer size where it does not get quality?)
Now, I would like to know if there is a way to optimize the size of game installed on the device.
Specifically, is there a way in itunes submission process where we can have additional downloadable content on the server and can download it based on the device ?
We can have assets broken based on the devices and still can save some size on each device.

There is no way to do this thru Apple. The app isn't even necessarily downloaded to a device initially, it might be downloaded to iTunes on a computer instead and synced to the device. Also the user might download it on an iPhone, sync it to iTunes, then sync it to an iPad, so the only time it would actually be downloaded is on the iPhone. So if it didn't include the iPad resources, then the iPad would have a problem running it in this scenario.
You could always have content that the app downloads from your server upon installation, which could reduce the size, but would delay the user starting to use the app upon first run. You could also include only retina assets and generate the non-retina assets upon first run by scaling the images to half size and saving them for subsequent use. This would also take a little bit of time, although probably less time than downloading assets.
You could always break the app into iPhone and iPad versions as well, which would reduce the app size. This would also give you the ability to set a different price point for the iPad version. This is very common and can definitely help reduce app size for all users. This would also be the recommended way of handling this. Note that this means you'll have two separate versions (different app IDs) on the store. Typically people append something like "HD" to the end of the iPad version when they do this.

Related

How to reduce the itunes app size?

When submitting an app to Apple, i noticed that even though the App bundle is 60 MB, the actual app that shows up on itunes is 54 MB. However, when making the Ad Hoc build, the ipa is only 30 MB.
My understanding is that this is due to DRM that Apple has: https://developer.apple.com/library/ios/qa/qa1795/_index.html
However, is there a better way to bypass this DRM that Apple puts?
Apple just came up with a solution where if you add all your resources (images, videos, etc) to the so called Assets catalog file AND configure each file according to the device type being used THEN you can dramatically reduce app size.
Think about it! You have 3 copies of every image: img.png img#2x.png and img#3x.png
Then why would you need to have the non-retina set of images on a retina device?
And this answers why you see lower app size when you build. xCode does this automatically, but you can fine tune in assets catalog. Here is how:
https://developer.apple.com/library/mac/recipes/xcode_help-image_catalog-1.0/chapters/CustomizingImageSetsforSizeClasses.html#//apple_ref/doc/uid/TP40013303-CH10-SW1
Oh yeah, not only app size reduces! Apple made seamless integration to make the AppStore downloadable app be smaller. By making a custom build for every kind of device. Just use the Assets :)

ridiculously high storage usage in iPhone 6+

I'm working (helping out) on an iOS app. On most devices the app's stabilized storage use is within 60-80MB. The same app (and same revision) on the iPhone 6+ starts using Gigabytes of data within minutes ... to the point of filling up the storage and I can't even run the app from XCode anymore. I've only been able to get it on the iPhone 6 once, but it's a regular occurrence on the 6+. I've also tried on a range of other devices from 5th gen iPod touch to the iPhone 5 and no other device goes over the 80MB.
The only portion of code that uses a significant amount of storage is the image caching, which caches the (static) images downloaded from the server keyed on the image id. Then again this code is (or seems to be) working fine on other devices. It is also a portion of the codebase that hasn't changed in a while.
Can anyone think of a reason why this issue is only seen on the iPhone6+ (and to a much lower extent the iPhone6)?
This isn't a solution, since it's impossible to know what's happening, but you should look at the following:
Is this reproducible on the simulator? (file system is easier to view)
Does the storage get freed when the app is deleted?
Can you see the data in the device organiser in xcode (they keep moving it, but somewhere you can plug in the device, see the app, and then see the file sandbox for that app)
What data is it? This should give you a clue as to its origin
is there a set of actions in the app that kick off the problem?
If this works, you should get a clue as to the offending code. Then, update your question, unless the solution is obvious!
The problem was that malloc stack logging was enabled and not set to compact. It logged every single allocation made by the app and it was the log file that grew so large.
As to why it only occured on the iPhone6 and iPhone6+, I still don't have an answer.
The problematic file was stack-logs.773.1006c8000.REDACTED.wmQj2k.index. It grew to 700MB almost right after login.
Much thanks to #jrturton because his answer really lead to this.

Universal app or not

I developed my first iphone app recently and would like to port it to an ipad. I've got a couple of related questions.
1) from what i've read, it sounds like creating a universal app will increase the size of the app that the user will download onto their iphone/ipad. is that right? my app is not small right now and i'd like to add some functions to the ipad version. Its something of a disincentive to package a universal app if it means a larger app for iphone users who won't benefit from the added functions added to the ipad app.
2) is it possible to have separate apps for the ipad and iphone but only make users pay for one version of them, if i don't go for a universal app? That is, if someone pays for the iphone version right now, i'd like them to have the ipad version for free when i finish it in about a month. is that possible outside of a universal app?
thanks,
rich
1) Yes, a universal app has everything for both versions so it is bigger. For a user that wants the app on both types of devices this isn't really a problem.
2) No, there is no way to have two separate apps such that the user can have both while only paying for one. At least it's not possible through standard means. If you make both apps free with IAP, then you could have your apps generate some sort of code that could be entered into the other to grant full functionality. Such a scheme is a lot of extra work.
Try to do a universal app and see how big it gets. All of the code is shared and as long as you don't have too many iPad-only full screen images or iPhone-only full screen images, the universal app isn't much bigger than a non-universal app.

Installed App Sizes Vs Appstore app sizes

Here is a question that had been bothering me. The other day I checked my wife's phone and pinterest app was eating up 2 GB of space while the actual app in the appstore is 26.8 MB. I know there must be user / log / crash data that is dumped in its apps document directory but that got me thinking how many other apps on her phone had large amount of user data stored compared to what the app size is in appstore.
So here are my questions of how to do all this using objectiveC
Sample Xcode iHasApp display's all the available apps installed on a device. Is there a way I check how much space they are taking in GB/MB etc?
Is there a way I can go query that app build size in appstore and tell the user hey its only X MB in appstore?
I know I can get to all the app installed on a device is there a way I can check when was an app last launched or used by a user?
Can I check how much space photo / video and music is taking up?
What I am trying do in the end is to see if I can make an app that shows user what they got installed on their device and make some informed decisions themselves.
So far all I am able to find is how to check total used and free space on a device and get a list of all apps installed.
Sample Xcode iHasApp display's all the available apps installed on a device. Is there a way I check how much space they are taking in GB/MB etc?
No. The APIs being used by iHasApp can only be used to check whether selected applications are present -- basically, all you get to ask "is ThisApp installed?", and you can build up a partial list of installed applications by running that check for a large number of common applications.
There is no way to get launch or disk usage information for other applications. I'm not sure last launch is even tracked at all by the device.
With this in mind, most of your other questions are irrelevant. It is not possible to do what you're after from an iOS application.

iOS App - Universal or separate targets?

I am trying to decide on whether or not an app should be Universal. Here are my requirements and questions related to each:
In-app purchases. If you download the app on the iPhone and make a purchase, it should reflect that in the iPad version. Obviously you shouldn't have to buy it twice. Is this a dealbreaker? Is there some way to tie in-app purchases together in separate binaries?
iCloud sync would be nice. The user creates content in the app and it would be great if the content created on the iPhone showed up in the iPad app. Again, does this mean it has to be universal?
The app is large and contains a lot of images. The main drawback of a universal app is that I'm capped at 50MB over-air download, and that the single binary means iPhones get all the iPad images and vice versa.
if I did make them two separate apps, do I separate everything in my Xcode project into two different targets and build that way?
Any answers to these questions or other things I should consider would be appreciated.
I think,better option is Universal App.
The app is large and contains a lot of images. The main drawback of a
universal app is that I'm capped at 50MB over-air download, and that
the single binary means iPhones get all the iPad images and vice
versa.
Yes. This is the only difficulty that I measured. However you can clearly specify which images should be load in iPad and which should only load in iPhone by naming it separately.
If Im correct , you can use some thing like myImage~iPhone.png or myImage~iPad.png

Resources