question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron and sandboxing on macOS

See original GitHub issue

Bindings should handle if it’s build for using in Electron app and use the system API to get writable directories for any internal data in sandbox.

Right now realm-object-server is created in the working directory that crashes the app.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
adeperiocommented, Oct 11, 2017

+1 for this feature! We are releasing an offline first desktop app in April so hanging out for this!

1reaction
TedMeftahcommented, Mar 30, 2017

Just wanted to mention that changing the working directory before requiring realm the app will work.

process.chdir('/directory/outside/app/folder')
const realm = require('realm')

Edit:

My point is as a workaround, you can change the cwd before require('realm') that will create realm-object-server in the new cwd and avoid the sandboxing issue.

The new cwd should be outside the .app directory, for example in main file:

import { app, BrowserWindow } from 'electron'
process.chdir(app.getPath('userData'))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sandbox is breaking the App · Issue #24936 · electron ...
This is happening to everyone, I tried to upload the app without enabling the sandbox. But apple rejects this app. Whatever you'd like...
Read more >
Mac App Store Submission Guide - Electron
Apps submitted to the Mac App Store must run under Apple's App Sandbox, and only the MAS build of Electron can run with...
Read more >
Make Electron app work with sandbox entitlement on MacOS ...
I have a MacOS app that was built with the Electron framework. Its entitlements do not include com.apple.security.app-sandbox .
Read more >
App Sandbox | Apple Developer Documentation
Overview. App Sandbox provides protection to system resources and user data by limiting your app's access to resources requested through entitlements.
Read more >
Any macOS Target - electron-builder
When using App Sandbox, the the com.apple.security.inherit key that is normally in the inherited entitlements cannot be inherited since the login helper is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found