macosamazon-s3dmggoogle-drive-pickerapfs

How to distribute a MacOS Disk Image (DMG) file to other Macs? Uploading to Google Drive or AwsS3 corrupts the file


I have created a DMG file and need to distribute it with a public link. Please note that the dmg file opens properly on all the macs if I transfer it through commandline scp (OpenSSH).

However, if I upload the same DMG file to Google Drive or AWS S3, and then redownload it to the same mac, it says the app has been damaged.

Error

What attributes change when the file is uploaded to Google Drive or AWS S3?

Update-1

Working DMG attibutes:

Non Working DMG attributes:

Tried removing all attibutes by using xattr -cr . Yet the working dmg works, and the non-working dmg doesn't work


Solution

  • MacOS sometimes adds the quarantine attribute if it doesn't trusts the app even though it is signed.

    Check it by running xattr /path/to/app.app in the terminal

    if it contains the 'com.apple.quarantine' attribute, then probably you will get the above error in a dialogue-box.

    To remove the attribute, run the below command before opening your DMG/App

    xattr -d com.apple.quarantine /path/to/app.app
    

    To completely avoid this hassle, the app must be notarized.

    References: