ADB Permissions
Prepare ADB (Android Debug Bridge)¶
You might need to attempt this process multiple times because it can be flaky.
-
Enable developer options on your device by going to device Settings -> 'About Phone' and tapping 'Build Number' many times until it says you've enabled developer options. The location of the Build Number may vary between devices.
Screenshot
-
Enable USB Debugging in developer options and plug your device into your PC.
Screenshot
-
Download the Android SDK platform tools from here and unzip it.
-
Open a terminal/command prompt in the unzipped folder.
-
Type or paste in a terminal:
adb devices
and your device then click the prompt on your phone to allow USB debugging from your PC.Prompt on phone
-
Type
adb devices
again and make sure you see the correct output as shown below.Correct command prompt output
Incorrect command prompt outputs
WRITE_SECURE_SETTINGS¶
There are 3 ways to grant this permission.
-
Use Shizuku (Key Mapper 2.4.0+ only). This is recommended on all devices running Android 11 and newer. This requires some setting up. Read the guide here.
-
If your device is rooted, Key Mapper can grant itself these permissions by enabling the "Key Mapper has root permission" toggle in the Key Mapper settings.
-
If your device is not rooted and you don't want to use Shizuku you must do the following...
-
Follow the "Prepare ADB" guide at the top of this page.
-
Type or paste in a terminal:
Attention
For CI builds (the app icon with a green square) the package name is
io.github.sds100.keymapper.ci
. For Debug builds (the app icon with a yellow square) the package name isio.github.sds100.keymapper.debug
. -
These permissions persist across reboots but need to be granted again if the app is reinstalled.
Enabling the Accessibility Service¶
You may wish to enable Key Mapper's accessibility service using ADB if you cannot do so in-app due to manufacturer constraints.
Tip
It is recommended to also follow the instructions to grant the WRITE_SECURE_SETTINGS permission on this page so Key Mapper can start and stop the accessibility service itself.
-
Follow the "Prepare ADB" guide at the top of this page.
-
To add Key Mapper to the List of the enabled accessibility providers, type or paste in a terminal: