Search code examples
macoscocoasoftware-distribution

How do I generate a single bundle when I'm generating two binaries? For archiving


When I try to archive the mac application we wrote, instead of getting a Mac App Archive I'm getting a Generic Xcode Archive:

enter image description here

I wast told it might be the case because we generate two bundles. One is a screensaver, Ninja.saver, and one is an app, Screensaver Ninja.app. Ninja.saver is copied to Screensaver Ninja.app's resources. These are the contents of that archive:

enter image description here

To try to figure it out, I removed Ninja.saver from my main app, so it's not built at all and lo and behold, now the archiver seems to work:

enter image description here

As an alternative I wrote a script that would remove the Ninja.saver just after copying it, that was not good enough.

How do I make the archiver work under this situation?


Solution

  • The problem is that your Products folder contains a screensaver in the Users directory and that's confusing Xcode's archiver. Look for the Install Directory for that target and remove it to avoid it being present there and Xcode's archiver will work fine.