Search Unity

Damaged apps when attempting to send as DMG or Zip across net

Discussion in 'macOS' started by copperrobot, Aug 23, 2022.

  1. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    I have an app that builds and works fine in OSX. No errors.

    If I attempt to send this for someone else to test it by uploading it, either as a zip or DMG, it causes it to break. This not only happens with people I send it to, but if I upload and download myself I also see the exact same error.

    This happens on GDrive, Dropbox and WeTransfer.

    This is using 2021.3.2f1 and build on an intel iMac with Monterey 12.4

    What should I be doing so that I can send builds to other people for testing on OSX?

    upload_2022-8-23_18-44-34.png
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Try using xattr to view (and modify) the extended attributes on the file.

    My guess is that this is just a security thing, and you can work around it in this way. But investigate and see what you find.
     
  3. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    Thanks - what should I be looking out for?
     
  4. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    If there's anyone who can suggest why a build would be 'corrupted' by uploading then I'd be happy to hear any ideas.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  6. copperrobot

    copperrobot

    Joined:
    May 22, 2013
    Posts:
    69
    EDIT: Okay, so this appears to be the solution.

    The actual steps are as follows:

    -Build from Unity to an xCode project.
    -In Signing and Capabilities set to Automatically manage signing (and do this for any steps in the future)
    -Set the Team as you would for iOS development (you need an apple dev account set up)
    -Signing Certificate is set to Developer
    -Hit the plus next to 'all' and add 'Hardened Runtime'
    -Make sure something is ticked on here or else the build will break
    -Archive
    -Distribute the app to DeveloperID and 'upload' - this sends it to be Notarised
    -Await notarisation confirmation email
    -Distribute again to DeveloperID
    -Export this time
    -I used a drive volume to upload it to Gdrive, but I suspect a zip is also fine
    -Works!
     
    Last edited: Aug 25, 2022
    JeffDUnity3D likes this.
  7. unitj75

    unitj75

    Joined:
    May 30, 2022
    Posts:
    26
  8. TerryGrey

    TerryGrey

    Joined:
    Oct 11, 2022
    Posts:
    1
    I am using unity addressables for on-demand packs and also using xcode plugin to build an instant app. I am using the unity's Build Settings -> Build and Run with my device connected. Everything works fine so far. On my side, I already had a published app store app and now building an instant app for the same build. So uninstall your custom built app and aim at a clean state is the key.
     
  9. sagos2013

    sagos2013

    Joined:
    Apr 3, 2019
    Posts:
    1
    As for me, I re-sign each built version of the application with these commands:
    Code (CSharp):
    1. xattr -cr "my-app-file.app"
    2. xattr -lr "my-app-file.app"
    3. sudo codesign -s - -f --deep "my-app-file.app"