<s>
The	O
Android	B-Application
Debug	I-Application
Bridge	I-Application
(	O
commonly	O
abbreviated	O
as	O
adb	O
)	O
is	O
a	O
programming	B-Application
tool	I-Application
used	O
for	O
the	O
debugging	O
of	O
Android-based	O
devices	O
.	O
</s>
<s>
The	O
daemon	B-Operating_System
on	O
the	O
Android	B-Application
device	O
connects	O
with	O
the	O
server	O
on	O
the	O
host	O
PC	O
over	O
USB	B-Protocol
or	O
TCP	B-Protocol
,	O
which	O
connects	O
to	O
the	O
client	O
that	O
is	O
used	O
by	O
the	O
end-user	O
over	O
TCP	B-Protocol
.	O
</s>
<s>
Made	O
available	O
as	O
open-source	B-Application
software	I-Application
under	O
the	O
Apache	B-Application
License	I-Application
by	O
Google	B-Application
since	O
2007	O
,	O
features	O
include	O
a	O
shell	B-Application
and	O
the	O
possibility	O
to	O
make	O
backups	B-Protocol
.	O
</s>
<s>
The	O
adb	O
software	O
is	O
compatible	O
with	O
Windows	B-Application
,	O
Linux	B-Application
and	O
macOS	B-Application
.	O
</s>
<s>
It	O
has	O
been	O
misused	O
by	O
botnets	B-Architecture
and	O
other	O
malicious	O
software	O
,	O
for	O
which	O
mitigations	O
were	O
developed	O
such	O
as	O
RSA	B-Architecture
authentication	O
and	O
device	O
whitelisting	O
.	O
</s>
<s>
Features	O
of	O
adb	O
include	O
copying	O
files	O
from	O
the	O
host	O
computer	O
,	O
installing	O
apps	O
,	O
viewing	O
logcat	O
output	O
,	O
getting	O
a	O
Unix	B-Application
shell	I-Application
,	O
and	O
rebooting	O
into	O
Qualcomm	O
EDL	O
mode	O
.	O
</s>
<s>
For	O
example	O
,	O
Android	B-Application
applications	I-Application
can	O
be	O
saved	O
by	O
the	O
command	O
backup	B-Protocol
to	O
a	O
file	O
.	O
</s>
<s>
It	O
also	O
includes	O
support	O
for	O
the	O
Java	B-Language
Debug	I-Language
Wire	I-Language
Protocol	I-Language
.	O
</s>
<s>
Some	O
graphical	B-Application
interfaces	I-Application
have	O
been	O
made	O
available	O
.	O
</s>
<s>
The	O
graphical	O
Android	B-Application
Device	O
Monitor	O
in	O
Android	B-Application
Studio	I-Application
can	O
be	O
used	O
for	O
retrieving	O
information	O
from	O
an	O
Android	B-Application
device	O
.	O
</s>
<s>
The	O
Android	B-Application
Software	I-Application
Development	I-Application
Kit	I-Application
(	O
SDK	O
)	O
was	O
first	O
released	O
in	O
2007	O
.	O
</s>
<s>
Since	O
2017	O
,	O
Google	B-Application
made	O
it	O
possible	O
to	O
download	O
adb	O
separately	O
from	O
the	O
Android	B-Application
SDK	I-Application
.	O
</s>
<s>
In	O
2015	O
,	O
Microsoft	O
released	O
an	O
Android	B-Application
emulator	O
that	O
can	O
connect	O
to	O
the	O
adb	O
client	O
.	O
</s>
<s>
In	O
2016	O
for	O
Android	B-Application
Studio	I-Application
2.0	O
a	O
5x	O
performance	O
improvement	O
was	O
made	O
for	O
installing	O
apps	O
and	O
pushing	O
files	O
through	O
adb	O
.	O
</s>
<s>
For	O
easier	O
usage	O
of	O
Android	B-Device
Things	I-Device
,	O
a	O
wrapper	O
was	O
made	O
in	O
2017	O
around	O
manual	O
adb	O
commands	O
.	O
</s>
<s>
For	O
Android	B-Application
11	O
in	O
2020	O
,	O
Google	B-Application
added	O
adb	O
incremental	O
installations	O
.	O
</s>
<s>
In	O
2020	O
,	O
Wi-Fi	O
adb	O
was	O
integrated	O
into	O
Android	B-Application
Studio	I-Application
for	O
macOS	B-Application
.	O
</s>
<s>
In	O
2021	O
for	O
Android	B-Application
12	I-Application
,	O
the	O
adb	O
backup	B-Protocol
command	O
was	O
limited	O
so	O
that	O
backing	O
up	O
user	O
data	O
from	O
apps	O
is	O
opt-in	O
using	O
a	O
per-app	O
manifesto	O
configuration	O
.	O
</s>
<s>
Fuchsia	B-Language
will	O
be	O
backwards-compatible	O
with	O
adb	O
.	O
</s>
<s>
For	O
Windows	B-Application
,	O
the	O
Android	B-Application
SDK	I-Application
contains	O
the	O
adb.exe	O
binary	O
that	O
can	O
be	O
extracted	O
and	O
installed	O
.	O
</s>
<s>
How-To	O
Geek	O
recommends	O
adding	O
the	O
folder	O
containing	O
the	O
binaries	O
to	O
the	O
PATH	B-Application
environment	O
variable	O
.	O
</s>
<s>
On	O
Ubuntu	B-Operating_System
,	O
adb	O
can	O
be	O
installed	O
with	O
the	O
android-tools-adb	O
package	O
.	O
</s>
<s>
For	O
Debian	O
,	O
it	O
has	O
been	O
recommended	O
to	O
also	O
install	O
the	O
android-sdk-platform-tools-common	O
package	O
next	O
to	O
the	O
adb	O
package	O
,	O
which	O
installs	O
the	O
udev	B-Application
rules	O
which	O
makes	O
it	O
possible	O
to	O
run	O
the	O
tool	O
without	O
root	B-Application
permissions	I-Application
.	O
</s>
<s>
For	O
macOS	B-Application
and	O
other	O
Linux	B-Application
distributions	O
,	O
the	O
platform	O
tools	O
can	O
be	O
downloaded	O
and	O
the	O
PATH	B-Application
variable	I-Application
can	O
be	O
modified	O
in	O
bashrc	B-Operating_System
.	O
</s>
<s>
In	O
Android	B-Application
4.2.2	I-Application
or	O
later	O
(	O
API	O
level	O
17	O
)	O
,	O
a	O
dialog	O
is	O
shown	O
with	O
an	O
RSA	B-Architecture
fingerprint	B-Algorithm
that	O
the	O
user	O
needs	O
to	O
accept	O
.	O
</s>
<s>
Starting	O
in	O
Android	B-Application
4.2	I-Application
,	O
the	O
developer	O
settings	O
are	O
hidden	O
by	O
default	O
.	O
</s>
<s>
After	O
that	O
,	O
the	O
USB	B-Protocol
debugging	O
option	O
can	O
be	O
enabled	O
.	O
</s>
<s>
Some	O
Android	B-Application
vendors	O
have	O
different	O
procedures	O
to	O
enable	O
it	O
.	O
</s>
<s>
If	O
the	O
touchscreen	B-Device
of	O
an	O
Android	B-Application
device	O
is	O
broken	O
,	O
it	O
can	O
be	O
possible	O
to	O
connect	O
a	O
mouse	O
to	O
the	O
device	O
using	O
USB	B-Protocol
On-The-Go	O
and	O
enable	O
USB	B-Protocol
debugging	O
.	O
</s>
<s>
The	O
adb	O
protocol	O
can	O
be	O
transported	O
over	O
USB	B-Protocol
or	O
over	O
Wi-Fi	O
through	O
TCP	B-Protocol
.	O
</s>
<s>
It	O
uses	O
a	O
client-server	B-Operating_System
architecture	I-Operating_System
.	O
</s>
<s>
The	O
first	O
is	O
between	O
the	O
client	O
and	O
the	O
server	O
and	O
the	O
second	O
is	O
between	O
the	O
server	O
and	O
the	O
daemon	B-Operating_System
.	O
</s>
<s>
The	O
adb	O
daemon	B-Operating_System
is	O
implemented	O
in	O
C	B-Language
and	O
located	O
in	O
the	O
Android	B-Application
user	O
space	O
.	O
</s>
<s>
The	O
daemon	B-Operating_System
is	O
facilitated	O
by	O
the	O
Android	B-Application
USB	B-Protocol
framework	O
,	O
UsbDeviceManager	O
and	O
UsbDebuggingManager	O
.	O
</s>
<s>
The	O
communication	O
mode	O
between	O
the	O
client	O
and	O
server	O
is	O
a	O
TCP	B-Protocol
socket	O
.	O
</s>
<s>
Up	O
to	O
Android	B-Application
2.2	I-Application
,	O
Android	B-Application
was	O
vulnerable	O
to	O
the	O
RageAgainstTheCage	O
exploit	O
.	O
</s>
<s>
The	O
adb	O
daemon	B-Operating_System
did	O
not	O
check	O
for	O
the	O
return	O
value	O
of	O
the	O
setuid	O
system	B-Operating_System
call	I-Operating_System
when	O
dropping	O
privileges	O
.	O
</s>
<s>
The	O
exploit	O
forks	B-Language
processes	O
until	O
it	O
fails	O
due	O
to	O
the	O
exhaustion	O
of	O
process	B-Operating_System
identifiers	I-Operating_System
.	O
</s>
<s>
When	O
the	O
daemon	B-Operating_System
crashes	O
and	O
restarts	O
,	O
it	O
cannot	O
start	O
a	O
new	O
process	O
with	O
dropped	O
privileges	O
and	O
keeps	O
running	O
as	O
root	O
.	O
</s>
<s>
Then	O
adb	O
provided	O
a	O
root	O
shell	B-Application
.	O
</s>
<s>
In	O
2017	O
,	O
a	O
security	O
vulnerability	O
was	O
disclosed	O
that	O
exploited	O
ADB	O
to	O
take	O
over	O
the	O
onboard	O
modem	B-Application
.	O
</s>
<s>
adb	O
can	O
also	O
be	O
used	O
to	O
remove	O
malware	O
,	O
by	O
booting	O
into	O
safe	B-Operating_System
mode	I-Operating_System
and	O
running	O
the	O
adb	O
uninstall	O
command	O
.	O
</s>
