Archive: Distribute Content instead of Distribute App

Hello,

I work with XCode 12.5 and Swift 5. I am a member of a development Team. I finished my first App and I want to start with Beta Testing using Testflight. I already tested the app on my mobile device and everything works fine. Furthermore I followed every step of this article: https://developer.apple.com/documentation/xcode/preparing-your-app-for-distribution

This article describes the steps to distribute my App for Beta Testing: https://developer.apple.com/documentation/xcode/distributing-your-app-for-beta-testing-and-releases

On of the first steps is creating an archive of my app. When I do this I don't get the option "Distribute App". I only get the option "Distribute Content".

The following distribution methods doesn't contain the options i need.

I already tried the solutions mentioned here: https://stackoverflow.com/questions/55467829/xcode-10-1-doesnt-show-distribute-app-option-when-archiving-cant-archive

In this article it seems like the solution is to change the "skip install" value. I have the "Skip Install" once in the "Projects" and "Targets" section. I already tried each combination of ticking yes and no, but the result stays the same.

I also tried it with different provisioning profiles. Once with the Type "Development" and once with the type "Distribution".

This is the first app that i wrote and published through the App Store. It could be that i am missing out something obvious? I am glad for everyone who can help me!

Thanks in advance Jakob

Accepted Reply

So there must be something wrong with the settings I guess?

Indeed.

Can you archive the project from this post

No I can’t. Well, I can do a Product > Archive but the Organizer says Distribute Content not Distribute App. Fascinating!

Checking the .xcarchive reveals that the Products directory is empty, just like in your case. The build settings reveals the problem. Check out this screen shot:

So Skip Install:

  • Starts out as No in the iOS defaults column.

  • Is not explicitly set in any of the columns.

  • Ends up as Yes in the Resolved column.

The only obvious source of the Yes value is the SampleCode.xcconfig file, but it does not set this build setting.

Weird.

Anyway, after a bunch of spelunking I finally figured out what’s going on here. It seems that the app target has the Installation Directory (INSTALL_PATH) build setting set to the empty string. So when you build an archive Xcode doesn’t put the app in the archive because it doesn’t know where to put it.

I’d appreciate you filing two bugs about this:

  • A bug against the TrueDepthStreamer sample code asking that it not set the Installation Directory this way.

  • A bug against Xcode asking for better diagnostics in this case.

Please post your bug numbers, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Replies

Do this:

  1. Open a Terminal window and enter cd but don’t press Return.

  2. Select the archive in the Organizer.

  3. Control click on it and choose show in Finder.

  4. Drag the .xcarchive item into a Terminal window.

  5. That will generate a command like this:

    % cd /some/long/path/archive-name.xcarchive
    

    Press Return to change to that directory.

  6. In Terminal, enter this command:

    % find Products
    

What does it print?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Thanks for your fast answer!

    It prints: Products

    Nothing else.

Add a Comment

Thanks for your fast answer!

It prints: Products

Nothing else.

@eskimo

I don't know if it helps, but if I am inside this directory and enter cd Products/ and type in ls -a I get:

. ..

It prints: Products

Nothing else.

OK, that’s not what I was expecting. Normally you see Distribute Content because the archive contains more than one product; in this case you’re getting it because the archive contains no products. Weird!

Have you perhaps set Skip Install on your app target? That’d be the most obvious cause of this specific symptom.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@eskimo

No, skip install was set to "no".

I built this app on the basis of another app that was published here:

https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/streaming_depth_data_from_the_truedepth_camera

If i try to archive this app i get the same result. I guess thats where the problem comes from?

No, skip install was set to "no".

Weird.

OK, at this point I’m going to recommend the following:

  1. Create a new test project from one of the built-in templates.

  2. Set the bundle ID to the same bundle ID as your main app.

  3. Build and run it, just to make sure it works.

  4. Then do a Product > Archive.

Does it have the same problem as your main app?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Does it have the same problem as your main app?

No, if I do this i can distribute it as an app. So there must be something wrong with the settings I guess? Can you archive the project from this post: https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/streaming_depth_data_from_the_truedepth_camera

So there must be something wrong with the settings I guess?

Indeed.

Can you archive the project from this post

No I can’t. Well, I can do a Product > Archive but the Organizer says Distribute Content not Distribute App. Fascinating!

Checking the .xcarchive reveals that the Products directory is empty, just like in your case. The build settings reveals the problem. Check out this screen shot:

So Skip Install:

  • Starts out as No in the iOS defaults column.

  • Is not explicitly set in any of the columns.

  • Ends up as Yes in the Resolved column.

The only obvious source of the Yes value is the SampleCode.xcconfig file, but it does not set this build setting.

Weird.

Anyway, after a bunch of spelunking I finally figured out what’s going on here. It seems that the app target has the Installation Directory (INSTALL_PATH) build setting set to the empty string. So when you build an archive Xcode doesn’t put the app in the archive because it doesn’t know where to put it.

I’d appreciate you filing two bugs about this:

  • A bug against the TrueDepthStreamer sample code asking that it not set the Installation Directory this way.

  • A bug against Xcode asking for better diagnostics in this case.

Please post your bug numbers, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I am also using a fork of the TrueDepthStreamer and running into the same problem, however:

  • INSTALL_PATH is set to /Applications/Xcode.app/Contents/Developer
  • Skip Install is set to 'No' for both Project and Targets
  • Running find Products from the terminal for the archive lists multiple files in the above listed path

And even with all of that set properly, I still get only Distribute Contents on a product archive. Again, this is a fork of the TrueDepthStreamer. Are we sure there aren't any other settings that could be causing this problem?

So, just to double check, I tried reproducing this the latest stuff:

  1. I download a new copy of the project from here.

  2. I opened it in Xcode 13.2.1.

  3. I changed the Team ID in Signing & Capabilities.

  4. I set the run destination to Any iOS Device.

  5. I choose Product > Archive.

  6. After that was done, Xcode opened the organiser with the archive selected. I confirmed that the Distribute App button was correctly named.

I recommend that you run the above yourself, just to set a baseline.

Again, this is a fork of the TrueDepthStreamer.

It’s hard to be sure what’s going on without more info about your fork but…

INSTALL_PATH is set to /Applications/Xcode.app/Contents/Developer

That should be just /Applications (or just delete the build setting and Xcode will inherit that value from the target type).

Skip Install is set to 'No' for both Project and Targets

Targets? The current sample only has a single target. What’s this other target?

Also, when building an iOS app you want to Skip Install enabled on secondary targets but disabled on the primary app target.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I was able to resolve this problem in my flutter based app. where VS Code formatter the info.plist file to different style and that's what broke my build and started showing Distribute content option. :D Unbelievable

Check this SO answer

I had copied a target and got this behaviour too. I was because the scheme still had the target from the copied target so it was really building two apps into one I guess. I could see this in the archive by using "Show package contents" in Finder. Within there is Products > Applications folder where there was two apps :(

Resolved by removing the target from the scheme under "Build".