Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine if is sandboxing enabled or not

How to check if sandboxing is enabled or not at OSX app runtime?

I need it for some assert tests for my library that can be run in different environments.

like image 712
Valentin Shergin Avatar asked Dec 19 '22 22:12

Valentin Shergin


1 Answers

Finally I have chosen this workaround (because it is simple):

func isSandboxingEnabled() -> Bool {
    let environment = NSProcessInfo.processInfo().environment
    return environment["APP_SANDBOX_CONTAINER_ID"] != nil
}
like image 89
Valentin Shergin Avatar answered Jan 21 '23 10:01

Valentin Shergin