My first macOS app code signing problems

Karina
Mac O’Clock
Published in
2 min readMay 19, 2020

--

Photo by Fabian Grohs on Unsplash

One day you decided to become a developer. You bought a new brand MacBook and launched Xcode. Or nice. You chose Cocoa App and run build for default project and…you get a bunch of errors. Em what? You did nothing, just two button clicks. No code, no changes and got:

libswiftObjectiveC.dylib
error: The specified item could not be found in the keychain.

I remember myself starting programming. What’s a keychain? — should I ask first. At that time I could never understand and solve this problem. Or bless you, Apple. Even with stackoverflow poor beginner would give up and never touch programming again.

The problem is with code signing. And even if you read a nice article from apple developers docs about code signing tasks you still might not understand what’s wrong. The reason is that all answers to similar questions are about developer’s certificates for distributing applications. I will show the solution if you want to build and launch your app locally just to learn Swift for example. I don’t know really why this solution is so hardly to search.

Double click on your project name in a project tree to open settings. Click on Build Settings item.

Scroll to Signing section

And instead of Mac Developer choose Sign to Run Locally (Ad Hoc Sign). Your friend can’t launch your app on his host, but you can test your app on your own Mac.

The build will succeed. Of course if you want to distribute your app later you need to buy developer certificate. But for your first steps in Swift Ad Hoc sign will be enough. Hope this helps. See you.

--

--