We do receive customer support request for our Mac App Store version where they report only getting an alert "Appname" is damaged and can't be opened. Deleting the app and downloading it fresh from the Mac App Store doesn't solve the problem. A reboot of the system seems to help, but the error seems to reappear after some time.
Mac App Development: "***.app" is damaged and can't be opened is unrelated as it is about development and/or testing of an app. This also seems to break on every uneven macOS release.
So far we where not able to find a common cause for this Mac App Store issue.
We are using receipt validation code from Apples Receipt Validation Programming Guide.
Exit If Validation Fails in macOS
If validation fails in macOS, call exit with a status of 173. This exit status notifies the system that your application has determined that its receipt is invalid. At this point, the system attempts to obtain a valid receipt and may prompt for the user’s iTunes credentials.
If the system successfully obtains a valid receipt, it relaunches the application. Otherwise, it displays an error message to the user, explaining the problem.
Do not display any error message to the user if validation fails. The system is responsible for trying to obtain a valid receipt or informing the user that the receipt is not valid.
So it seems the receipt validation fails on a valid receipt and the app calls exit with a status of 173. The system successfully obtains a receipt, it relaunches the application, and again the app calls exit with a status of 173.
Now we are presented with the "Appname" is damaged and can't be opened. alert.
Note that the system seems to cache this result, after double 173 exit, no further launch will be attempted when you double click the app, it will just show the alert again.
The reason for the receipt validation error appears to be a missing MAC address (computer’s GUID).
Without a changelog or tech note it is hard to tell exactly, but based on the Wayback Machine it seems that Apple added new Validating Receipts on the Device sometime around Sept 2021. The new code does seem to address the issue.
Compared with the code from the legacy documentation, the new code is does not only look for build-in en0, but also falls back to en1 or non-build-in en0.
I'm trying to learn to load apps on my iPhone from Xcode. When I do I keep getting "Codesign wants to access key "access" in your keychain, I put I my login password but it keeps popping up over and over. I've tried my computer login so many times, apple account password, and many others.
Had the same issue. It was fixed after I entered my mac user password and hit Always Allow.
Solve this problem by doing this.
Enter your Mac Login Password and Choose "Always Allow"
One or More dialogs opened and positioned in the same dialog, repeat step 1 until all dialogs closed. (So you thought your
password wrong but repeat "Always Allow" with your Mac login
password tricky part :) )
Hope it will work.
I pressed Deny by mistake and I was stuck, no way to code sign any Pods.
This is how I solved the problem:
Open the keychain
look for the key com.apple.gs.xcode.auth.com.apple.account.AppleIDAuthentication.token
open it
click on the Access Control tab
at the bottom there's Always allow access for these applications: -> add Xcode in the list
Don't forget to press Save Changes
2019: I had to enter the password like 40 times... must be a bug... but it worked
I encountered this running a brand new project. Neither the Allow or Always Allow button seemed to work, however it wasn't giving me the 'incorrect password' shaking feedback. What was happening was that there were multiple dialog boxes all in the same position, so as I entered a password and clicked Allow nothing changed visually. I ended up having at least 3 dialogs all stacked up on each other, which I only discovered when I tried dragging the dialog. Entering passwords into each of them let my project finish building.
Enter your login password, and select always allow, to avoid typing in your password multiple times.
I clicked the "Deny" button, and the keychain was off.
I locked the keychain:
And then I entered the login keychain again.
Following worked for me!
open keychain-management on your Mac
select "login" on the left pane
look for the key which is causing this issue. Mine was iOS Developer...
double-click the key and select "Allow access to all programs" in the access column
Restart Xcode and try to build again. It will ask you again but with the additional option to "Always allow. Enter your macOS user password as password and press "Always allow".
Let me know if it worked for you.
Enter the password you use to open you Mac session and click on "Always allow" until all alerts are closed. The other buttons do not work...
The same dialog asking for the KeyChain password has 3 buttons. Most likely the wanted password is that for logging in to your Mac. If you press "Allow" it only works for some tiny aspect and will ask again, which is very puzzling. You need to press "Always Allow". The verification team at Apple is very weak, they need some 'normal' developers in the design team for the chain of events to get an app in the app store. Normal developers have very sketchy ideas about KeyChains and Certificates and Profiles.
Okay Guys, after literally 2,5 hours of trying to fix that error I managed to find a solution that worked on my two Mac Machines.
These are the steps I did:
Open Xcode -> Preferences
Go to the Accounts Tab
Click the button on the bottom right telling 'Manage certificates'
Look for the name of the certificate
Open the keychain manager
Select in the menu the Sign-In tab
Do a right-click and then delete on the certificate that was named in the Xcode settings page before
Go back into Xcode and see Xcode creating a new certificate(The window will be empty for a couple of seconds and then there will a new certificate lighten up.
Rerun your app
I hope that could help you guys. It helped me a lot! :)
Liam
In my case, I didn't have the 3 buttons described in the other answers ("Allow", "Always Allow", "Deny"). I only had an "OK" button.
I tried entering the following passwords:
Login password, the one I use to login to my Mac.
Apple ID, the one I use to authorize App Store purchases and login to my iCloud.
Apple Developer ID, the one I use to login to App Store Connect.
But none worked.
What did work, strangely, was leaving the password text field empty.
Hope this is a bug, but don't worry you can continue your build without any problem. Like all others I am sharing my experience.
The dialog will pop up again and again, and I thought that I maybe forgot the keychain password.
what you have to do is enter the Mac login password and press Always allow.
if nothing is happening, check the dialog by dragging it with mouse, and move the dialog. you will find same dialog underneath.
try separating all the dialog through out the screen and find the dialog that is working. (ie, maybe only only dialog will accept the password and close. yeah, it may reopen new dialogs anyway. but never mind.)
Continue the password entering and pressing always allow until it give up.
I entered the password around 20 - 30 time I guess. and it worked pretty well.
now thinking that if I press always allow on the first time, maybe it will not come again.
I have had the same problem. I had more than one Xcode window open, closing all other open windows leaving only the current one open solved the problem for me.
As of August 31, 2018.
Resolving:
1. Search Keychain Access
2. [KEYCHAIN] Login | [CATEGORY] Passwords
3. Look for you email address and double click. <it might not be necessary but just try this>
4. [ACCESS CONTROL] choose "allow all application to access this item".
5. Rebuild to your phone. If you have error choose a virtual device and build (to reset the build objects). Then choose to rebuild to your phone again.
In my particular case, the dialog box did not have the Always Allow, Allow or Deny options, so I wasn't able to use the above solutions. I had to go to my Keychain Access app, choose the certificate, go to "Access Control" and add Xcode in the apps to Always Allow access. After that, the dialog showed the Always Allow button, which I could use successfully.
For me, I realized one of the dialogs was opened in another workspace. Once I discovered that and input my password there it went through.
What helped me was to enter the incorrect password. After that, when entereing the correct password, new dialogs started to open in different places of the workspace. I had to enter the correct password about 20 times hitting Always allow. Which helped!
For me, the problem was caps lock. and it seems it may ask you a couple of times to input your password or you will have to enter a password once and press always allow.
Just click on the certificate in the keychain access and change the access permission if you want to avoid entering password at all, else select Always allow and it will prompt probably 4-5 times and it will be done.
I was also having the problem while running the carthage script in the build phase. (Xcode 9)
I get that dialog for each and every framework I had added plus the app itself. You can see a very dark shadow growing.
I could bypass it by entering the password every time and hitting "Always Allow".
I had the same problem: while building iOS release for Flutter project, was asked for keychain password, entered Apple ID password for developer account, no luck.
Finally succeeded by entering password for computer I was using (which was an on-line mac server).
Hope that helps.
For me XCode had expired my login...XCode-Preferences - saw it had logged me out, loged back in. Only came up with this solution by chance thanks to a related post here that took me to preferences in XCode !
dialogs open on each other some of them should confirm first , if you enter password many times and it dosen't work just drag a dialog and see if there is any other dialogs under it and confirm them. it works for me
Annoyingly, for me it opened up several boxes, so I had to pay attentions that when I clicked always allow for one box, another box, flickered. So had to add all the passwords and clicks in an ordered fashion according to the mac.
then I got it to work.
For those that have had no luck with the provided answers:
Try to first turn off any app that might be changing your mouse behaviour (like "Mos", that smooths scrolling) and any bluetooth mice you have connected.
Here is best solution:
1-)revoke all certificate in your apple developer account
2-)log off your developer account inside xcode
3-)relogin with your developer account
4-)re-create certifiactes...
It will work like charm :)
The popular answers are outdated.
Update 2022: Just press Enter. See also here
I was facing the same issue and for me the "Always Allow" option was not coming so I had to enter the username and password again and again and after entering for almost 150+ times, I checked in case the p12 is there or not earlier which I added also but it got removed somehow and I added the p12 again and boom I got the "Always Allow" option also and in a single try it worked.
For me this worked like a charm. Try doing this. This error of pop up will go.
A reboot prevents it from opening the dialog.
I'm working on a new OS-X Daemon process (run from launchd) and would like to get popup window every time it crashes with all relevant information (pid, path to crash file, etc...). This will sure help my debugging effort in this early stage of the development.
Basically, i want to have the same behavior as a UI application. For example :
I've made some research and found out about the CrashReporter, but i don't know how to register my app to this service. But it seem like there's no way to trigger popup windows from this service, since crashes are system level events and apps have zero interaction with those.
Maybe there's a way to do so by setting up some parameters in app bundle or via Info.plist ?
EDIT: looking at the crash report manual, it looks like the unexpected dialog works only on GUI user mode, and not on daemon that runs from launchd. perhaps i'm missing something ?
In addition, if the program that crashed is running as a logged in GUI user, CrashReporter will present the user with a dialog asking them whether they want to submit a bug report to Apple (see Figure 1). If the user clicks the Report button, CrashReporter displays another dialog that shows the details of the report (see Figure 2) and allows them to comment it before submission.
I've read that Developer option enable in addition to application crashes, crashes are also displayed for background and system processes. but unfortunately i doesn't work for me.
thanks
Seems like the problem occurs since my background process runs under root privilege, and root privilage process (not just daemons) cannot initiate any UI widget on the screen.
I guess that the only way to deal with it, is by catching the signal that trigger the crash, and send details for a proxy process that run on non-root mode and can initiate the UI dialog box with crash details.
I would be happy to hear for better proposals.
Since CrashReporterPrefs, which allowed you to enable this behavior for daemons, no longer comes with developer tools, you can change the behavior to show the dialog for daemons by running this command in the Terminal:
defaults write com.apple.CrashReporter DialogType Developer