Handling Permissions for Accessibility, Microphone, Screen Recording, ...

Last edited on

macOS has become much stricter from version 10.14 on about privacy-related APIs. Those include accessibility features and access to the microphone, camera or recording the screen itself.

Apart from the AUT itself Squish also needs some permissions during testing:

Due to the way Squish launches the AUT process, all permissions that the AUT requires also need to be granted to Squish IDE. It may be sensible to have one test case that triggers all permission dialogs subsequently in the AUT. This test case can be executed manually on new build machines to grant permissions as needed.

Permissions given to the AUT outside of test runs do not apply during testing. Squish launches the AUT like a command-line application by directly running the executable inside the app bundle. Therefore all permissions required by the AUT need to be granted to Squish IDE, too, since it is the GUI process that launched the AUT.

Granting Permissions to an Application

The process to grant permissions is documented in Apple’s macOS user guide . This article talks about Camera access. Accessibility and Screen Recording can be granted the same way.

When a permission is requested for the first time by an application you will also see a dialog that explains what to do.

Resetting Permissions Given to an Application

Permissions given to a specific application can in some cases be revoked via the Privacy pane in macOS System Settings. Some permissions can only be revoked via the command line using tccutil:

tccutil reset All your.bundle.id

Use the following commands to reset all permissions given to Squish IDE:

tccutil reset All com.froglogic.squish.ide.product
tccutil reset All com.froglogic.dummysquishide

Note: The second command revokes permissions given to Squish IDE’s launcher bundle. This is not strictly necessary since in normal operation, only squish.ide.product will receive permissions after asking for it. If you granted permissions by manually adding an IDE app bundle to the Accessibility list for example, it may accidentally have been the IDE launcher though.