Xcodebuild archives all targets instead of one

I need to archive a specific schema from my xcodeproj . For this, I run

 xcodebuild archive \ -scheme $SCHEME \ -target $TARGET \ -archivePath $ARCHIVE_PATH 

Although I explicitly define the scheme and purpose, the resulting xcarchive contains both goals and the subsequent IPA export call complains about

 error: the archive at path '<path>.xcarchive' is not a single-bundle archive ** EXPORT FAILED ** 

Why xcodebuild create an archive with multiple packages?

+6
source share
2 answers

This was a problem with design schemes. I created new schemes, duplicating the original, and not adding a new one. As a result, the circuit then indicated 2 goals in the build section instead of one (only God knows why), and Xcode will not let me delete another target.

As soon as I deleted all the circuits and created them from scratch, everything worked fine.

+5
source

Another scenario when this happens is when your subproject (Target dependency) has Skip Install set to No in the build settings.

To find this subproject, check the contents inside the archive. The product folder should contain only one product.

In my case, the subproject was a dynamic library and was added to the archive in the path /<path to archive>/Products/usr/lib/<library> .

+2
source

Source: https://habr.com/ru/post/981862/


All Articles