Root Access¶
Rooting allows Android mobile operating system users to reach privileged control (known as root access) over various Android subsystems. As Android uses the Linux kernel, rooting an Android device gives similar access to administrative (superuser) permissions as on Linux or any other Unix-like operating systems such as FreeBSD or macOS.
Root toggle is not available for all Android images. Please refer to the table in the Root and Unroot a device section.
Root and Unroot a device¶
Some Android images are not rooted by default and can be rooted dynamically:
Android version | Architecture | Initial state | Dynamic root toggle |
---|---|---|---|
14.0 | arm64 | 🔐 Unrooted | 🟢 🔓/🔐 |
x86_64 | 🔐 Unrooted | 🟢 🔓/🔐 | |
13.0 | arm64 | 🔐 Unrooted | 🟢 🔓/🔐 |
x86_64 | 🔓 Rooted | 🔴 | |
12.1 | arm64 | 🔐 Unrooted | 🟢 🔓/🔐 |
x86_64 | 🔓 Rooted | 🔴 | |
12.0 | arm64 | 🔐 Unrooted | 🟢 🔓/🔐 |
x86_64 | 🔓 Rooted | 🔴 | |
11.0 | x86_64 | 🔓 Rooted | 🔴 |
10.0 | x86 | 🔓 Rooted | 🔴 |
9.0 | x86 | 🔓 Rooted | 🔴 |
8.1 | x86 | 🔓 Rooted | 🔴 |
8.0 | x86 | 🔓 Rooted | 🔴 |
7.0 | x86 | 🔓 Rooted | 🔴 |
6.0 | x86 | 🔓 Rooted | 🔴 |
5.1 | x86 | 🔓 Rooted | 🔴 |
5.0 | x86 | 🔓 Rooted | 🔴 |
gmsaas CLI is required to use this feature.
Rooting and unrooting the device is controlled via the device property persist.sys.root_access
which can be changed only by command line, with adb, for the moment.
To toggle root:
- Connect your instance to ADB with gmsaas
- Run the following ADB command:
adb shell setprop persist.sys.root_access 3
Once the device is rooted, root access is available and can be granted to applications or obtained via the command line interfaces, as explained in the sections below.
To disable root, run the ADB command:
adb shell setprop persist.sys.root_access 0
Root access for applications¶
Root toggle is not available for all Android images. Please refer to the table in the Root and Unroot a device section.
Superuser is already installed on rooted Genymotion SaaS 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 (adb)¶
Connecting as a root user may damage your instance or jeopardize your data. USE AT YOUR OWN RISK!
Root toggle is not available for all Android images. Please refer to the table in the Root and Unroot a device section.
Run the command adb shell
to login to the instance console as shell user and use the su
command to switch to root user:
adb shell
vbox86p:/ $ su
:/ #
Or, you can also use the adb root
command to switch directly to root user:
adb root # Switch to root user
adb shell # Access the device shell
:/ #
Then, use adb unroot
to switch back to standard user.
How to sign your system app¶
Unrooted images are user build types, whereas rooted images are user debug build types. Please refer to the table in the Root and Unroot a device section for more information.
Unrooted images are signed with release keys: you can use the keys provided in this public repository to sign your system apps.
Rooted images are signed with the default AOSP test keys.