How to open downloaded app from browser in Big Sur

Issue #750

Recently when distributing staging releases of my app PastePal via GitHub release or Google Drive, people had hard time opening it

Screenshot 2021-01-15 at 10 26 26

The displayed error is

You do not have permission to open the application

The more verbose error when using open command in Terminal is

The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826 “kLSNoLaunchPermissionErr: User doesn’t have permission to launch the app (managed networks)” UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2508, NSUnderlyingError=0x7fa9c750d850 {Error Domain=RBSRequestErrorDomain Code=5 “Launch failed.” UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x7fa9c750e010 {Error Domain=NSPOSIXErrorDomain Code=153 “Unknown error: 153” UserInfo={NSLocalizedDescription=Launchd job spawn failed with error: 153}}}}}

From further investigation. This is restriction of Big Sur for downloaded zip file from browser

  • When decompressing the .zip, the application contents didn’t retain the execute bits. Add it back with sudo chmod -R 755 /path/to/app
  • Since the application was downloaded by a web browser the quarantine bits are set on the decompressed files. Remove that with sudo xattr -dr com.apple.quarantine /path/to/app

It still didn’t work despite the fact that I enabled apps from identified developers and that I also notarized my app.

Screenshot 2021-01-15 at 10 29 49

The reason was I zip my PastePal.app before uploading to Google Drive. Now I just upload the bare PastePal.app, upon downloading Google Drive still zip the app but when I apply the chmod and xattr it works now 🎉

Read more


Updated at 2021-01-15 09:31:23

Comments

You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.