Root Access

Root Access

Root Access is privileged control over Android subsystems.

Rooting is the process that enables privileged control on Android devices.

Privileged control is also known as root access.

Root access provides permissions similar to administrative permissions on Linux or macOS.

Note

If you wish to use ADB and/or SSH, read the following first:

Un-Rooted images

Un-Rooted images are images that are not rooted by default but can be dynamically rooted.

| Android version | Initial state | Dynamic root toggle | | 16.0 | Unrooted | / | | 15.0 | Unrooted | / | | Automotive - 14.0 | Unrooted | / | | 14.0 | Unrooted | / | | 13.0 | Unrooted | / | | 12.1 | Unrooted | / | | 12.0 | Unrooted | / | | 11.0 | Unrooted | / | | 10.0 | Unrooted | / | | 9.0 | Rooted | × | | 8.1 | Rooted | × | | 8.0 | Rooted | × | | 7.0 | Rooted | × | | 6.0 | Rooted | × | | 5.1 | Rooted | × |

Root and Un-root a device

Rooting and unrooting the device is controlled via the device property persist.sys.root_access which can be changed either by command line or with the HTTP API.

Web UI

Navigate to the Configuration left-bar menu in the Web UI, and in the Root Access card, click to toggle root access.

Note This feature is only available with Android 10.0 and above for the moment. With lower versions, the toggle switch will be disabled:

To root the device

adb shell
setprop persist.sys.root_access 3

To revert back and unroot the device

adb shell
setprop persist.sys.root_access 0

The current value of the property

adb shell
getprop persist.sys.root_access

Response:

{
  "key": "persist.sys.root_access",
  "value": "0"
}

HTTP API

Device properties can be changed using the HTTP API endpoint

/configuration/properties.

To root the device, set the persist.sys.root_access property value to "3" with the POST method. Example

curl -u <username>:<password> -X 'POST' \
'https://34.247.73.220/api/v1/configuration/properties/persist.sys.root_access' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"value": "3"}'

To revert and unroot the device, set the property value to "0". Example

curl -u <username>:<password> -X 'POST' \
'https://34.247.73.220/api/v1/configuration/properties/persist.sys.root_access' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"value": "0"}'

The current value of the property can be retrieved with the GET method. Example

curl -u <username>:<password> -X 'GET' \
'https://34.247.73.220/api/v1/configuration/properties/persist.sys.root_access' \
-H 'accept: application/json'

Response:

{
  "key": "persist.sys.root_access",
  "value": "0"
}

Once the device is rooted, root access is granted and available for applications and from command line interfaces.

Root access for applications

Android 10.0 and above images are no longer rooted by default: Superuser will only be available once the device has been manually rooted.

Superuser is already installed on rooted Genymotion Device image virtual devices: when an application requests root access, it prompts a pop-up asking whether root access should be authorized or denied.

The default policy can be changed using the Superuser application.

Root access by command line

Connecting as a root user may damage your instance or jeopardize your data. USE AT YOUR OWN RISK!

Android 10.0 and above images are no longer rooted by default: root access is only accessible after the device has been manually rooted.

Android 9.0 and below images are always rooted: when logging with adb shell, you will already be logged as root.

Run the command

adb shell
to log in to the instance console as root and use the
su
command to switch to root user:
cloud_arm:/ $
su
:/
#

You can also use the

adb root
command to switch directly to root user:
adb root
adb shell
# Switch to root user

Then, use

adb unroot
to switch back to standard user.

Set root access on deployment

It is now possible to use

user data parameters to toggle root when deploying an instance.

Please refer to Automate instance parameters for detailed instructions.

How to sign your system app

Android 10 images and above are user build types, whereas older versions are userdebug build types.

Android 10 and above images are signed with release keys: you can use the keys provided in this public repository to sign your system apps.

Other versions are signed with the default AOSP test keys.