Project

General

Profile

ADB » History » Version 8

Denis 'GNUtoo' Carikli, 11/28/2019 10:58 PM
Follow developers guide rules for the links

1 1 Paul Kocialkowski
h1. ADB
2
3
h2. Installing ADB
4
5 8 Denis 'GNUtoo' Carikli
See the [[ToolsInstallation]] page for how to install adb.
6 1 Paul Kocialkowski
7 5 Wolfgang Wiedmeyer
h2. Enabling ADB
8
9
In the settings, open *Developer options*. In the Debugging section, enable *Android debugging*.
10
11 1 Paul Kocialkowski
h2. Authorizing the device
12
13
In order to allow your host computer to access ADB on the device, it must be allowed on the device. A window should pop up when connecting USB, asking whether to allow USB debugging. 
14 2 Paul Kocialkowski
*Note: when booting with USB plugged in, the window doesn't pop up and you have to disconnect and reconnect the USB cable to see it happen.*
15 1 Paul Kocialkowski
16
h2. Accessing root shell
17
18
Once allowed, you can access the device shell using:
19 4 Wolfgang Wiedmeyer
20 1 Paul Kocialkowski
<pre>
21
adb shell
22
</pre>
23
24 5 Wolfgang Wiedmeyer
The shell is running as an unprivileged user.
25 1 Paul Kocialkowski
26 6 Denis 'GNUtoo' Carikli
To allow root access, open the *Developer options* in the settings. There, press *Root access*. In the pop-up menu, select either *ADB only* or *Apps and ADB*. A window with "Allow root access?" might pop up and explains the security tradeoffs of enabling root access. After reading the text, select OK to enable root access.
27 5 Wolfgang Wiedmeyer
28
To finally gain root access, use:
29
30 1 Paul Kocialkowski
<pre>
31
adb root
32
</pre>
33
34 4 Wolfgang Wiedmeyer
The following shells will then be run as root.
35
36 1 Paul Kocialkowski
h2. Modifying the system partition
37 4 Wolfgang Wiedmeyer
38 5 Wolfgang Wiedmeyer
Replicant is installed on the system partition. By default with most devices, this partition is mounted as read-only and can't be modified.
39 4 Wolfgang Wiedmeyer
You can mount the partition as writable filesystem using:
40
41
<pre>
42
adb remount
43
</pre>
44
45
Files under @/system/@ can now be edited.