Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

invalid package contents - com.apple.quarantine

After uploading the app archive generated by Xcode (which passed validation), I received an email stating one or more files had the com.apple.quarantine extended file attribute and to remove the attribute before uploading the archive again. A particular PNG file was identified.

In the terminal, I ran the command: xattr -d com.apple.quarantine <path to PNG file> The response was: "No such xattr: com.apple.quarantine"

I also ran "xattr -rd" on the directory containing all app files. No response.

The identifed PNG file at fault is a screenshot used only in the app's User Guide. It was created 5 years ago using Apple software: Ctrl-Shift-4 to capture the image, Preview to resize.

Given the file does not have the quarantine extended attribute, I can only conclude that Xcode is adding the attribute when building the archive. How do I stop Xcode from adding the attribute?

I have search Google with numerous search criteria and check the Apple Developer Forum, but could only find how to remove the attribute using xattr; nothing about Xcode adding the attribute when building an archive.

Answered by DTS Engineer in 838349022

Try this command to see if you can find any additional files:

xattr -lr <path_to_app_bundle>

you can use this command to remove extended attributes:

xattr -cr <path_to_app_bundle>

Also, try running using the -lr command on your entire project directory to see if there are any files affected.

Accepted Answer

Try this command to see if you can find any additional files:

xattr -lr <path_to_app_bundle>

you can use this command to remove extended attributes:

xattr -cr <path_to_app_bundle>

Also, try running using the -lr command on your entire project directory to see if there are any files affected.

Thank you for your suggestions, which solved the issue. First I executed, as suggested, the command xattr -d com.apple.quarantine <path to .png file> which output "No such xattr: com.apple.quarantine"

Then I rebuilt the archive and executed xattr -lr <path to app.xcarchive> and searched the output for "com.apple.quarantine" The only file found was the .png file the attribute had been deleted from. Message was "com.apple.quarantine: 0082;5f0206c2;Preview;"

One can conclude the xattr -d failed to remove the quarantine attribute even though the output said there was no such attribute.

Next I execute the command xattr -cr <path to app.xcarchive> No output

Finally ran the command xattr -lr <path to project directory> No file had the quaranting attribute. The quarantine attribute on the .png file had been removed.

Uploaded the archive again; it was accepted.

Conclusion: If the archive is rejected because it has a file with the quarantine attribute, run xattr -cr on the archive to remove it. Then upload the archive again.

That's great news. I'm glad to know you were able to resolve the issue. Thanks for the summary of the steps you used.

With that said, it sounds like you're modifying the app archive after it has been built by Xcode. This is not optimal. Ideally you should be making changes to your sources in your project directory before building your app to rectify this problem. Though this is working for now, there may be problems with this approach sometime in the future when submitting your app.

invalid package contents - com.apple.quarantine
 
 
Q