App can not be opened because it is from an unidentified developer

Solution 1:

Broadly speaking, when distributing apps outside the Mac App Store you need to:

  1. Set the signing identity to Developer ID
  2. Create your Developer ID certificates
  3. Create your app Archive
  4. Validate your app
  5. Export a Developer ID signed app
  6. Sign the installer package (not applicable in your case)
  7. Test the app's behaviour with Gatekeeper enabled and again with Gatekeeper disabled

Troubleshooting issues such as this can be tricky because it's easy to make assumptions about how much the OP (in this case you) knows, etc. From reading your question I'm going to assume the first three steps are taken care of.

So, let's start by double-checking how you're validating your app.

Validate your app

To validate a Developer ID-signed app, follow these steps:

  1. In Xcode go to Product > Archive
  2. The Archives organizer window will appear
  3. Select the archive for the app in question
  4. Click on the Validate button
  5. A dialogue box appears asking you to select a method for validation
  6. Select the Validate a Developer ID-signed Application option
  7. Click on Next
  8. In the next window select a team from the pop-up menu
  9. Click on Choose
  10. Click the Validate button

This will identify any validation issues. If any are found, this will be your problem (or at least part of it), so you will need to resolve this.

If no issues are found, then proceed below.

Export a Developer ID-signed app

  1. Still within the Archives organizer window, select the archive for the app in question
  2. Click on the Export button
  3. A dialogue box appears asking you to select a method for export
  4. Select the Export a Developer ID-signed Application option
  5. Click on Next
  6. In the next window select a team from the pop-up menu
  7. Click on Choose
  8. Click the Export button

Once your app is exported you should test with Gatekeeper enabled and again with Gatekeeper disabled.