I added mail.app as run executable in my bundle in Xcode Mac OS project and while running it, I see this error
"Message from debugger: cannot attach to process due to System Integrity Protection"
As suggested by many other developers I created a duplicate copy of Mail.app and placed it outside of the /Applications directory hierarchy, and set the scheme's executable to that duplicate app. As the copy of the app does not have SIP attributes, so Xcode can run it under the debugger.
But still the error is not eliminated