Application can’t be opened» for the app built in XCode


I've built an App in Xcode in release mode. Is signed with valid Developer ID certificate. And the app launches fine on some MacBooks. But on another launch fails with error 

The application %name% can't be opened.

Then I try to launch it from terminal with open command it says 

LSOpenURLsWithRole() failed with error -54 for the file /Applications/Gaetano Lunches.app.

And then I try to launch directly the binary file from package contents it says

-bash: /Applications/Gaetano Lunches.app/Contents/MacOS/Gaetano Lunches: Operation not permitted

On all MacBooks app installation from Anywhere is allowed. spctl-master is disabled. Permissions for files are correct. But the app cannot be launched.

MacBook Pro 15", macOS 10.14

Posted on Jul 10, 2019 6:24 AM

Reply
4 replies

Jul 12, 2019 5:15 AM in response to obukhow

You need to provide more information.


Have you checked the system log? (Console app)


What does your app do? (brief description, resources used, etc.)


Where is the app installed? (system application folder or user application folder)


Have you tried running your app as a brand new user? (your problem appears to be environmental)


What is the setting of system preferences -> security and privacy -> allow apps downloaded from?



Jul 14, 2019 5:02 AM in response to obukhow

Let me be clear. I've never programmed in Swift.


That said, I've read your code and the following line indicates that your program depends on a resource.


let url = URL(string: "http://obukhow.ru/oggetto/gaetano-api.php")!


If the resource is not available to a user what will the program do?


Here is a link to swift code that might be of use

https://www.swiftbysundell.com/posts/constructing-urls-in-swift


Specifically, constructing a URL extension called staticString and then using as follows

let url = URL(staticString: "http://obukhow.ru/oggetto/gaetano-api.php")


replacing the above line.


Hope this helps


Jul 12, 2019 5:39 AM in response to disguise

My app get some data from URL with JSON and displays it in NSTable (very simple app).

The source code could be found here https://github.com/obukhow/OggettoLunchMac

The built app could be downloaded from http://obukhow.ru/downloads/obl.dmg


I tried to launch app both from downloads folder, from system application folder.

As I described in my question the problem appears only for some users. On my macbook the app works fine. So may be it is really environmental problem. On all MacBooks app installation from Anywhere is allowed. spctl-master is disabled. Permissions for files are correct.


I've checked system log for the machine where the app cant be launched and it show following text

Jul 12 15:34:18 MBP-Dmitry com.apple.xpc.launchd[1] (com.apple.xpc.launchd.oneshot.0x10000aa1.Oggetto Business Lunches[55855]): Service could not initialize: 18E226: xpcproxy + 11291 [1534][1571C9B2-C489-3268-9D6B-73137AC77303]: 0x1
Jul 12 15:34:18 MBP-Dmitry com.apple.xpc.launchd[1] (com.apple.xpc.launchd.oneshot.0x10000aa1.Oggetto Business Lunches[55855]): Service exited with abnormal code: 78


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Application can’t be opened» for the app built in XCode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.