Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see if the size of my iOS 14 app clip is below 10MB?

I have been building an app clip using the Xcode 12 beta. According to the documentation the application should be less than 10MB, but I have no way of seeing if I am actually below this limit.

like image 781
Lucas van Dongen Avatar asked Jul 02 '20 06:07

Lucas van Dongen


2 Answers

I disagree with the current previous accepted answer. It is certainly wrong since it includes the code for all architectures, maybe the bitcode and does not have the final compression from the app store. You should refer to Apple's guide on how to estimate the app size. Look here for "Create the App Size Report".

tl;dr Find the clip size like this:

  1. Archive your app in Xcode.
  2. Export your archived app as an Ad Hoc, Development, or Enterprise build.
  3. In the sheet for setting the development distribution options, choose “All compatible device variants” for app thinning, and enable Rebuild from Bitcode.
  4. Sign your app and export it to your Mac.

In the exported folder you will find a file called App Thinning Size Report.txt

It now has 2 entries. One for your main app and one for your app clip. Look for a line like:

App size: 6.7 MB compressed, 18.6 MB uncompressed

I assume the 10MB limit refers to the compressed size of the app since network traffic should be the limiting factor. Seems like my assumption was wrong, the 10MB limit refers to the uncompressed size according to an Apple Developer Technical Support Engineer. Refer to kanekins comment below for more details.

like image 143
LimeRed Avatar answered Sep 26 '22 15:09

LimeRed


The app clip will be uploaded as a part of your regular app and is included in the archived version of your application. You can find out what the size is of your app clip if you take the following steps:

  • If you archive your app, it will generate an entry in the Organizer (under Window).
  • Right click that archive, then show it in the Finder.
  • Right click the .xcarchive file, Show Package Contents
  • Drill down through Products into Application
  • Right click the application and Show Package Contents
  • You'll find a folder name "AppClips" that has the app clip application
  • Verify it's size
  • If it's size is too big, again use Show Package Contents to analyze the contents of the App Clip
  • The culprits are usually frameworks or assets files

Some ideas to prevent the size from billowing out of control:

  • Use less or no external dependencies, so don't just copy the list of Cocoapods or packages of your main app
  • If you shared assets between the app and the app clip verify that it doesn't contain anything you might not need
like image 40
Lucas van Dongen Avatar answered Sep 25 '22 15:09

Lucas van Dongen