Spawn java process from sandboxed macOS app

Hi there! I am trying to publish a macOS app on App Store, thus the app must be sandboxed. The app is built with Electron and electron-builder. A tool of the app needs to run a local web server, to do so a java runtime and a .jar file are downloaded during runtime and the server is started using spawn. In the MAS version of the app, running from TestFlight, I get EPERM error when spawn is called. Both java's runtime and .jar are downloaded to app's container. I have tried also downloading them to outside the container (by saving them in the directories that are symlinked to outside of it) by I get the same error. How could I solve that issue?

Answered by DTS Engineer in 773308022

to do so a java runtime and a .jar file are downloaded during runtime

This is not going to work. On the technical side, anything that a sandboxed app downloads is automatically quarantined, which prevents the app from executing it. That’s why you’re hitting this error.

There are also business considerations. Read clause 2.4.5(iv) of the App Store Review Guidelines.

The obvious path forward is to embed this stuff within the app that you upload to the Mac App Store.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

to do so a java runtime and a .jar file are downloaded during runtime

This is not going to work. On the technical side, anything that a sandboxed app downloads is automatically quarantined, which prevents the app from executing it. That’s why you’re hitting this error.

There are also business considerations. Read clause 2.4.5(iv) of the App Store Review Guidelines.

The obvious path forward is to embed this stuff within the app that you upload to the Mac App Store.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Spawn java process from sandboxed macOS app
 
 
Q