Notarizing DMG with app bundle nested in folder

I'm building an app that is nested inside a folder in the distributed DMG. To be clear, this means that when the user opens the DMG, they will see the DMG contents which will contain a folder, and within that folder they will find my app bundle.


When I run the notarization command, I get this output:


$ xcrun altool --validate-app \
  --file dist/example-project.dmg \
  --primary-bundle-id com.example.MyBundleIdentifier \
  --username $AC_USERNAME \
  --password $AC_PASSWORD
2020-02-26 16:24:41.176 altool[5275:117673] *** Error: Unable to validate archive 'dist/example-project.dmg': (
    "Error Domain=ITunesSoftwareServiceErrorDomain Code=-21017 \"Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in 'dist/example-project.dmg'.\" UserInfo={NSLocalizedDescription=Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in 'dist/example-project.dmg'., NSLocalizedFailureReason=Unable to validate your application.}"
)

I can open the DMG and verify that it has the app bundle nested within a folder. Googling variations of "notarize dmg" has not helped, and `xcrun altool --help` does not reveal any flags that I can use to specify the bundle path within the DMG.


How do I notarize a DMG with an app bundle nested within a folder?


Thanks in advance.

Answered by noahlt in 408754022

As a quick correction, it appears the flag is actually `--notarize-app`. With that caveat, this worked, thank you!

The

--validate-app
command is something you’d do for a Mac App Store app, not a Developer ID product. To notarise a product, use
--notarized-app
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

As a quick correction, it appears the flag is actually `--notarize-app`. With that caveat, this worked, thank you!

Notarizing DMG with app bundle nested in folder
 
 
Q