Control your device from your computer - ADB tutorial

preview_player
Показать описание

In this video I want to tell you about the incredibly useful piece of software called ADB (Android Debug Bridge) that essentially lets your android device and your computer communicate to one another and I want to show you a bunch of different ways that you can use it in order to fully control your Android device without needing to physically touch or interact with it! Instead you can use the computer that your device is connected to, to do a HUGE range of different things.

Some of the awesome things that you can do with ADB (that I showcase in this video) are; transferring files between your computer and device, accessing your app's data saving location, sending user input like taps and text input so you can automate user interaction without touching the phone and taking screenshots and screen recordings.

I also want to show the Android developers out there some brilliant commands that will be insanely useful to them and enhance their app development process. Once you learn about these commands your android app creation process will never be the same. These are things like telling you what packages are installed on the device, understanding your app's task with information about the view hierarchy and activity & fragment stack and even creating automated taps, swipes and button presses, so that you never need to pick up your phone and waste precious seconds logging in to your app again, just let adb do it for you!

There are so many other useful adb commands that I wasn't able to include in this video, otherwise it would gone on for HOURS, but there are plenty of links and amazing cheat-sheets below (in the links section) for you to enjoy and find even more commands that will help you take control of your device... From your computer...
You can find a list of the commands that I was able to cover in this video in the timestamps section (below in description), along with of course, the timestamp in the video of when I explain and demonstrate that particular command...

Timestamps ======================

00:00 - Intro
02:33 - Install ADB (Add to PATH)
04:22 - Enable ADB with Developer Options
07:45 - See what devices are plugged in (adb devices)
08:09 - How to use multiple devices (adb -s id)
09:17 - Get info about the device (adb shell getprop)
10:19 - Access a shell in the phone (adb shell)
12:44 - How to transfer files
13:07 - How to put files ONTO the device (adb push)
14:03 - How to take files FROM the device (adb pull)
15:04 - Take a screenshot (adb exec-out screencap)
16:16 - Record the screen (adb shell screenrecord)
18:35 - Fake user finger presses (adb shell input tap)
19:43 - How to easily get UI element coordinates
21:11 - Fake user typing in text (adb shell input text)
21:39 - Fake user pressing buttons (adb shell input keyevent)
22:31 - My example automated user login flow
23:05 - Useful commands for Android Devs...
23:12 - List installed packages (adb shell pm)
23:53 - See app's data stored on device (run-as package)
24:59 - Inspect shared preferences stored on device
25:54 - Get info about running app (adb shell dumpsys)
28:46 - Easily view activity & fragment stack (easy-dumpsys)
30:52 - Outro
31:38 - Bloopers

Links ======================

ADB official documentation:

ADB Tutorial:

Add ADB to your PATH env variable:

Install ADB independently (part of platform-tools):

ADB input keyevent - List of Key events you can use:

ADB command cheat-sheets:

Exec-out vs shell:

ADB Dumpsys information (including modes):

My Github repo for Easy Dumpsys (easy-dumpsys):

-------------------------------------
Tools:
-------------------------------------
Camera: Canon M50

-------------------------------------
Credits:
-------------------------------------
In Video Music: Youtube Audio Library
In Video Background: Made by me
Thumbnail Background: Photo by Johannes Plenio from Pexels

Vid: 45

#adb #adbtutorial #androiddev
Рекомендации по теме
Комментарии
Автор

All the commands shown in the video:

adb devices
adb devices -l
adb -s emulator-5554 shell
adb shell getprop
adb shell getprop "ro.build.version.release"
adb shell

cd /sdcard
touch temp.txt
echo "hello" >> temp.txt
cat temp.txt
exit

adb push temp_del.txt /sdcard
adb pull /sdcard/temp_del.txt .
adb exec-out screencap -p > ./pic.png
adb shell screenrecord "/sdcard/vidfile.mp4"
adb shell input tap 538 1099
adb shell input text "hello"
adb shell input keyevent 4
adb shell pm list packages

run-as bk.yt.example

adb shell dumpsys activity

Tuligarnio
Автор

Thank you so much! I've been looking for a while for a video like yours. I needed somebody to explain it to me from the very beginning how to connect the phone to the computer. Keep up the good work!!!

tanias
Автор

This is by far the most useful video I have ever seen about an Android Tool. if someone explained the gradle hell like this it would amazing.

faisalahmad
Автор

Amazing stuff...till now I just knew the long form of ADB. Now I know what actually it is. Thanks a ton.

jonsnow
Автор

I Love the way your videos. So easy to understand and quite entertaining. Keep them coming!!

lynnmcpherson
Автор

excellent video already, im just in the start. I love the production quality already!

koenpauwels
Автор

Everything that i was looking for...packaged beautifully in a 30 min video.. Thanks a lot

vaibhavshoran
Автор

GREAT job! I'm interviewing for a QA role and your video has been VERY helpful!

carltheyoda
Автор

Thanks buddy i was litterally finding a tutorial for adb😅 it will definitely help me out ☺️

ackerh
Автор

This is an amazing introduction to ADB. Thanks!!!

hainish
Автор

Never replied to a YT video, but this one is too good. Great job!

Leo
Автор

info about running app is just gold mine. thank you so much for sharing this video.

bhavinpithawala
Автор

To be honest, one of the best videos I've seen in my life on youtube.

Fillmoreb
Автор

Goddamn I love this video of yours
I love how you make the start fun and don't make it boring

You are amazing
Please keep making such more 🥰

harshit
Автор

I watched it multiple times, and all the time I had the intention to hit that Like button again.

robimegu
Автор

Guy, your intro has won me to watch the rest of the video. Thanks

Dudurapidez
Автор

I love the way you explain! You got yourself one more subscriber!

shamanmanouvha
Автор

I like this, the explanation is clear, thank you bro!!! :)

rimbadirgantara
Автор

Just cool and excellent presentation . Thank you ben

kutaibaa
Автор

Alright... How can I overcome the obstacle from 5:13 if my device has a broken screen and the main goal of using ADB was to extract data such as phone numbers, text messages, and photos? Is it going to be possible to access the phone without touching it?

mateuszskupny