Mac application asking for accessibility permission repeatedly

1.9k Views Asked by At

I have created a Mac application written in electron-vue. It requires keyboard access and screen recording access.

Ideally, when I give permission it should start working immediately.

But my app sometimes work after restarting. Sometimes, It keeps asking for permission after every restart even though we have given the permission.

I am not able to understand what is being done wrong.

Can you please help?

My package.json.

    "name": "pramod-dektop-creator",
    "version": "0.0.1",
    "description": "pramod-desktop-creator",
    "author": "Pramod <[email protected]>",
    "scripts": {
        "build": "node .electron-vue/build.js && electron-builder",
        "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
        "build:dir": "npm run build:clean && node .electron-vue/build.js && electron-builder --dir",
        "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
        "dev": "node .electron-vue/dev-runner.js",
        "pack": "npm run pack:main && npm run pack:renderer",
        "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
        "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
        "postinstall": "electron-builder install-app-deps",
        "rebuild": "electron-rebuild -f -w sqlite3"
    },
    "main": "./dist/electron/main.js",

    "build": {
        "afterSign": "notarize.js",
        "asar": true,
        "productName": "pramod-dektop-creator",
        "appId": "org.pramod.desktop-creator",
        "protocols": {
            "name": "pramod-dektop-creator",
            "schemes": [
                "pramod"
            ]
        },
        "directories": {
            "output": "build"
        },

        "dmg": {
            "sign": false,
            "contents": [
                {
                    "x": 410,
                    "y": 150,
                    "type": "link",
                    "path": "/Applications"
                },
                {
                    "x": 130,
                    "y": 150,
                    "type": "file"
                }
            ]
        },
        "mac": {
            "icon": "build/icons/icon.icns",
            "gatekeeperAssess": false,
            "entitlements": "info.plist",
            "entitlementsInherit": "info.plist",
            "hardenedRuntime": true
        },
        "win": {
            "icon": "build/icons/icon.ico"
        }
    },
    "iohook": {
        "targets": [
            "node-72",
            "electron-70"
        ],
        "platforms": [
            "win32",
            "darwin",
            "linux"
        ],
        "arches": [
            "x64",
            "ia32"
        ]
    },
    "license": "",
}
1

There are 1 best solutions below

0
On

Please check whether you have given permissions to correct application.

How?

Go to Security & Privacy settings. enter image description here

Right click on your application and select the option.

It will take you to the application for which permission is given.

Cross check whether it is the correct application you are giving access to.

For me, installed application was different than what I gave permission to.

I deleted duplicate application and gave permissions again. After that it started working.

May or may not solve your issue but worth a try.