Is it possible for an app in the Mac App Store to obtain Accessibility permissions?

I have an app developed using ElectronJS that requires Accessibility permission to monitor mouse and keyboard events through the iohook package. I want to publish it on the Mac App Store, but it seems that:

  1. The Mac App Store mandates Sandboxing, and
  2. Sandboxing prohibits Accessibility permission.

As a result, it seems that an app on the Mac App Store cannot obtain Accessibility permission.

Can someone confirm if this is accurate or if there's a workaround?

Answered by DTS Engineer in 788928022

Hmmm, that depends on what you mean by “Accessibility permission”. That user-level privileges covers a bunch of different code-level facilities.

Sandboxed apps do not have access to all the Accessibility APIs. We call that out Protecting user data with App Sandbox. However, some things that are commonly done by accessibility apps can be done in a sandboxed app.

I have an app developed using ElectronJS that requires Accessibility permission to monitor mouse and keyboard events through the iohook package.

I can’t speak to that specific third-party library, but sandboxed apps can monitor events. My go-to API for that is CGEventTap.

Share and Enjoy

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

Yes, the Mac App Store mandates sandboxing, but no, sandboxing does not prohibit Accessibility permission. In fact I have two apps in the Mac App Store that can request and use Accessibility permission.

Accepted Answer

Hmmm, that depends on what you mean by “Accessibility permission”. That user-level privileges covers a bunch of different code-level facilities.

Sandboxed apps do not have access to all the Accessibility APIs. We call that out Protecting user data with App Sandbox. However, some things that are commonly done by accessibility apps can be done in a sandboxed app.

I have an app developed using ElectronJS that requires Accessibility permission to monitor mouse and keyboard events through the iohook package.

I can’t speak to that specific third-party library, but sandboxed apps can monitor events. My go-to API for that is CGEventTap.

Share and Enjoy

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

Actually, in my app, I am also using accessibility APIs to obtain the app's accessibility object reference. Will that be possible in a sandboxed app? Below is the code I am using:

AXUIElementRef app = AXUIElementCreateApplication(targetApplicationProcessID);
Will that be possible in a sandboxed app?

No.

Share and Enjoy

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

Is it possible for an app in the Mac App Store to obtain Accessibility permissions?
 
 
Q