9

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.

Lucas van Dongen
  • 9,328
  • 7
  • 39
  • 60

2 Answers2

23

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.

LimeRed
  • 1,278
  • 13
  • 18
  • 2
    Thanks for the great answer. I have one point to add: There is a related thread on Apple Developers forum. According to a reply from an Apple Developer Technical Support Engineer, 10M limit refers to **uncomressed** not compressed size. > The 10MB limit is the size of the uncompressed, thinned variant of the app clip. (source: https://developer.apple.com/forums/thread/651461?answerId=626584022#626584022) – kanekin Aug 20 '20 at 12:20
  • @nab : When you export your archived app from the organizer, do you choose your AppClip instead of your App ? The app thinning report should then contains only AppClip informations. – vmeyer Oct 01 '20 at 15:51
  • For those who wonder which variant to look at : it's the universal variant, the biggest one. Message from AppeStoreConnect : "The universal variant app clip /Payload/MyAppClip.app exceeds the maximum allowable size of 10MB." – vmeyer Oct 01 '20 at 15:53
  • Hi LimeRed, I exported my app with app clip with Ad Hoc and chose the app thinning options. I do see the app clip inside the app IPA. However when I checked the App Thinning Size Report.txt, I do not see an entry for my app clip, only for my app eg: Variant: Myapp.ipa Supported variant descriptors: Universal App + On Demand Resources size: 20.6 MB compressed, 43.1 MB uncompressed App size: 20.6 MB compressed, 43.1 MB uncompressed On Demand Resources size: Zero KB compressed, Zero KB uncompressed Would appreciate any insight, thanks. – eph515 Mar 29 '21 at 17:22
5

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
Lucas van Dongen
  • 9,328
  • 7
  • 39
  • 60