My Swift macOS App does not run from Xcode

This problem is really driving me crazy. I created this IoT app to work on my Mac Pro running Mojave. I use Xcode 11.3.1 and Swift.

My app is running properly when I say "Sign to run locally". But as soon as I switch to development and sign it, it will not run anymore. There is no sign of a problem, it just says:

Finished running App : App

No other message. When I switch on debugging (Scheme -> Debug Executable) it says:

Message from debugger: Error 1

I cannot run my application locally because I need an entitlement to register the IoT devices.

So now I ask for your help or suggestion. Something is obviously wrong, but what and how do I find it? I tried a couple of things like reinstalling Xcode, but no result so far.

I tried different things, but no success so far.

  • Creating a new project from scratch
  • Switching to another computer
  • Creating new credentials

This is really though, as there is no indication as to what goes wrong. It could be some setting that I have wrong, but why does it work in run locally. So my current best guess is that something is wrong with my credentials. That's the reason I tried item 3.

Does anyone have suggestions how to find out whether my credentials are the source of the problem. Any suggestions what I could also try would be appreciated.

Today it appeared as if I magically made it to work: After receiving the multicast entitlement I followed these steps: https://developer.apple.com/forums/thread/663271 Alas in the end no success.

I think that I solved it. The following article proved helpful: https://developer.apple.com/library/archive/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TNTAG19

My problem was in chapter: How do I resolve the CodeSign error: CSSMERR_TP_NOT_TRUSTED?

After downloading and installing the necessary Apple Certificates my App worked. I got the above mentioned error message when running:

codesign -v <MyApp>

Without debugger my app works, in Xcode I still get a secinit error that I still need to solve. But at least my apps can work now.

My Swift macOS App does not run from Xcode
 
 
Q