Size limit of my ios app particularly Core Data - ios

I have developed an app. It is an in-house app. I want to know if there is any limit on the size my app can take up on the iOS device. My app connects to a web-service and downloads data from SQL server. Maybe 1000s of rows. How much data can my app store on the iOS device? Can someone explain it in simple terms. I read its 2GB. But i think that is the size of the app when you install it.Correct? In archives section of organizer my app now says 1MB. So that 2gb, is the limit there correct?50 mb is the size of OTA download. I want to know how much space my app can occupy on the iOS Device. How much core data space can my app occupy? More questions to come. Thanks.

As far as I am aware you have can save as much data as you want on the device until it runs out of memory. Core Data store (eg sqlite file) just lives in a file in the documents directory of the device. Once there is no more room on the device, and there are no caches to clear I assume it will throw errors 'no space available' and such.
Write a quick little app that loads a large image from the bundle and saves it to the documents folder with a different filename (timestamp?), loop it until the device crashes and you might get to see how much memory it lets you have :)
(Do it on an actual device, not the Simulator)

2GB is the maximum size of the app that you are allowed to upload to iTunes and I don't think relates to how big your app can eventually become on the device.

Related

App Store File Size Warning in iTunes Connect

Version 1.0 of my app has finally been completed. It's a simple application with the ability to view multiple leaflets and links to videos from a charity-based organisation. I've uploaded it to iTunes Connect for the final build, but I'm seeing a "App Store File Size Warning" in iTunes Connect.
The app itself contains 220 images (each has an average size of 500 Kb but some much smaller). The idea of the app is to have the charity's leaflets all accessible within the app in an offline state (hence why they're not downloaded from a server somewhere, etc).
The app itself also contains links to the companies videos. So the videos itself are not in the app, but rather links to the videos are populating the app's UITableViewCells.
Reading many questions about App Store size reduction, I have moved 1200 titles and URLs for the videos to text files rather than storing them in code. I have reduced the sizes of the images (they can't be reduced anymore because they will become low resolution). I'm just not too sure what I can do to get to the required limit? Or, could I still submit as it's only a warning and not an error?
For example, I downloaded a game today that was 190Mb. How does that get around this?
The app supports iOS 7, 8 and 9, so I can't use App Thinning just for that. I see some information on this: Max size of an iOS application but it's not new, etc.
Is it possible for me to bypass the warning in iTunes Connect and submit anyway? (I'll submit after the ITC X mas break).
Any thoughts on this would be really appreciated.
That won't cause any issue. If your app is less than 100 MB the warning won't be there. Apple prefers to keep the IPA size below 100 MB for keeping the app mobile data friendly (To download using mobile data).
There are several ways you can reduce the size:
Use App Thinning
Implement an one time download mechanism in your app, through which download the files on first start (I'm doing such a mechanism in 3 of my app, that needs around 300 MB of resource for proper working)
You can read more techniques in Reducing the size of my App

iOS deleting all app sandbox data automatically

I have a very strange issue that has been occurring to a few users of my app. One of the users actually described the issue to me.
My app downloads magazine data to the device to allow for offline reading. This means that users can sometimes have around 10 gigs+ downloaded to the device.
The problem this user experienced (and a few others have too) is that randomly all sandbox data gets deleted from the app (included core data files). The user told me that he was downloading something in a different app and got the "Storage Almost Full - You can manage your storage in Settings" popup message.
He went to the settings app and went to General > Usage. He then saw the app was using around 13 gigs of data. While he was in that list he said every time he went out of the Usage tab, then back in the app's data was getting smaller and smaller. Until eventually the app said it was using 0mb.
When he logged back into the app all his data was deleted and core data was also removed which lead the app to think he was a completely new user with no data downloaded.
I then ran some tests on my own where I made sure my device only had 100mb of space available. I then started downloading in the app. The warning message popped up alerting me I was running out of space and I ignored it and continued downloading. I have now downloaded about 1.5 gigs of data and am still downloading and the device seems like it is freeing up space somewhere else to make room for my downloads.
I've searched far and wide and have found no one else ever experiencing a problem like this. So my questions are:
Has anyone else every experienced this issue before?
Does Apple have a policy that will remove app data from the app that uses the most space if the device is running out of space?
Is there an algorythm that decides which app will get cleared when space is running out?
Is there a way to tell the OS not to remove data when running out of space?
Any help would be appreciated!
Assuming you're storing the data in the caches subdirectory:
On iOS 5.0 and later, the system may delete the Caches directory on
rare occasions when the system is very low on disk space. This will
never occur while an app is running. However, you should be aware that
iTunes restore is not necessarily the only condition under which the
Caches directory can be erased.
Documentation here

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

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.

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.

App Size and dynamically downloading resources

My application that will be posted soon is going to dynamically download images and resources that have to do with art when something is unlocked in the app. This will keep down on app size and the app will only download resources when it is needed. Very similarly to Droid development since they cap at 50mb sizes.
Does anyone know if this could potentially harm the approval process to apple? The expansions that will be downloaded could be around 30mb and could be very slow if the user decides to do this on data. Any advice or prior issues with apple on some type of process like this would be very helpful.
Thanks in advance.
You should be good. I have an app that downloads every new XKCD webcomic when it is released. Each being an image, this has added considerable size to the app.
To play it safe, I would suggest including something in the app description (within the app and on the iTunes store) that tells users the app dynamically downloads content. There is no rule against it, but letting the user know is always good.

Resources