Unable to export App Clip separately with Ad Hoc distribution

Hi,

I created an App Clip for my App and I am able to launch it from XCode (Version 12.4 (12D4e)) on my iPhone. I can see the App Clip in the App Library of my iPhone.

Next I want to create an Ad Hoc distribution so my team members can load the App Clip for testing.

According to https://developer.apple.com/documentation/app_clips/distributing_your_app_clip :

"You may also choose Ad Hoc or Development distribution. Note that you need to export the App Clip and the full app separately in these cases."

I do have a separate identifier and Ad Hoc provisioning profile for my App Clip and when I archive my app and select to distribute it Ad Hoc, I ensured both my app and app clip's provisioning profiles are selected and am able to successfully go thru the export process. I also see my app clip in the app's archive and final ipa after export. However after app thinning etc, in the final Review ipa screen there is just an Export button which exports the main app's IPA.

How do I export the App Clip separately? I do not see an option to export them separately. After exporting I only see my App's IPA.

Finally in my App Thinning Size Report.txt, I do not see any entry for my App Clip. Here is the content:

Variant: XXXXXX.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 help. Thanks.
Hi sojourner, if the app clip is not exported, please send a feedback. If possible, please also include a sample project to help demonstrate the problem.

thanks!
Thank you for your reply.

The App Clip is exported as part of the main app's IPA but not as a separate entity. ie after I go through the Ad Hoc distribution process, I only see the main app IPA as the only entity, but if I uncompress the main app IPA and inspect its content, the App Clip is there inside.

I need clarification though on the documentation: "Note that you need to export the App Clip and the full app separately in these cases." Please clarify if this means 2 separate entities (ie the main app IPA and a separate App Clip) or just the one entity ie main app IPA with the App Clip inside?

If it is possible to export the App Clip as a separate entity please advise on how I can do this ie what option(s) I should see and use during the Ad Hoc distribution process because currently I do not see those options.

Thanks.
Accepted Answer
This is a bug with SPM packages that use binary assets, discussion thread.

The fix in the case of plugins is mentioned here.

The fix in this case of app clips is adding the following snippet in Archive > Post actions -> Run script phase:
Code Block bash
FRAMEWORK_NAME="<ADD THE NAME OF THE BINARY ASSET HERE>"
APP_PATH=$(dirname "${ARCHIVE_PRODUCTS_PATH}/Applications/${EXECUTABLE_PATH}")
APPCLIP_FOLDER_PATH="AppClips"
APPCLIP_INSTABUG="${APP_PATH}/${APPCLIP_FOLDER_PATH}/${FRAMEWORK_NAME}.framework"
if [ -d "${APPCLIP_INSTABUG}" ]; then
echo "Removing ${FRAMEWORK_NAME} from appclips at ${APPCLIP_INSTABUG}"
rm -rf "${APPCLIP_INSTABUG}"
else
echo "${FRAMEWORK_NAME} does not exist at ${APPCLIP_INSTABUG}"
fi


Unable to export App Clip separately with Ad Hoc distribution
 
 
Q