I have a Mac app that is 443,245,675 bytes.

When I copy it to a flash drive, the copied version is only 443,239,527 bytes and the app package becomes invalid (spctl -a fails).

This difference (6148 bytes) is the size of a .DS_Store file exactly, but none seems to exist in the app package. My hidden files are visible and I've looked using ls -l — there's no .DS_Store file there.

What's going on here and how do I fix it so my app doesn't become invalidated every time it's copied? Note that the app still runs even though spctl fails. That said, should I even worry about this?

  • What formats are your flash and source disks ? – Mark Oct 24 '16 at 11:26
  • I suspect your USB is FAT and your main disk HFS+. This is why distributions of apps are usually done by creating a .dmg to contain the app – Mark Oct 24 '16 at 11:32
  • You're right! The USB was FAT32. That narrows down the solutions considerably. – corpico Oct 25 '16 at 0:15

Your thumb drive is likely formatted as FAT32 (or just FAT if older).

Copying the app to something that isn't formatted as Mac OS Extended, probably resulted in the loss of things like file owner, permissions, etc, that may have been needed to run/validate it with the system.

Either consider

  1. Packaging it as a .dmg, or
  2. If this is something you might need often, you could reformat the thumb drive as HFS+ (after backing up anything important on it). Consider copying the app file with the flag to preserve settings:

    cp -p source_file target_thumb_drive

  • Thanks. The drive was FAT32. I'll try getting creative with the copy over. – corpico Oct 25 '16 at 0:13
  • For anyone having this problem in the future: My dmg installer would install the app on a FAT32 drive, leaving behind certain permissions native to Mac. What I did was zip the app, have the installer move it to the drive, and then run a post-installation script to unzip it and then delete the zip from the drive. What's left is a Mac app with permissions intact. – corpico Oct 25 '16 at 0:19
  • @corpico why not just do the standard OSX thing of distributing a .dmg – Mark Oct 25 '16 at 10:21
  • @corpico I'm glad to hear you got it working. I'm happy I was able to help. – Allan Mason Oct 25 '16 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .