Xcode 13.4.1 (13F100) "Command CodeSign failed with a nonzero exit code" which certificate I should delete?

Viewed 69

sorry if I redact more than I need to, I’m an idiot beginner.

I tried to run a test project on my own physical iPhone but ran into a Command CodeSign error. Researched a bit, it looks like I can try deleting duplicate/redundant certificates. As you can see in the screenshot, not 1, not 2 but my Xcode has 3 seemingly duplicate certificates. My question is: are they really all the same? I see that I am signed in with a certifcate dated Aug 2021. Should I delete the new ones or keep the latest one that is expiring in Sep 2031? I am very worried that I will shoot myself in the foot if I delete the wrong ones.

(If this doesn’t work, I would have to delete and and reinstall Xcode completely. It would take a lot of time as my MacBook is an older model. So any advice to avoid that will be greatly appreciated. I already spending way too much time on this “side error” instead of actually practicing/learning Swift. It’s soul crushing. )

BIG THANKS in advance.

enter image description here enter image description here

Edit: enter image description here

1 Answers

I'd suggest going to the Accounts preferences (your 3rd image) press the + button and choose add Development or Distribution certificate (depending on what your current needs are).

It should then show a valid date for your certificate which it currently does not.

Related