Ovo će prikazati povezane uređaje; ako se pojavi "neovlašćeno", to znači da morate otključati svoj mobilni i prihvatiti vezu.
Ovo ukazuje uređaju da treba da pokrene adb server na portu 5555:
adb tcpip 5555
Povežite se na tu IP adresu i tu Port:
adb connect <IP>:<PORT>
Ако добијете грешку као што је следећа у виртуелном Андроид софтверу (као што је Genymotion):
adb server version (41) doesn't match this client (36); killing...
To je zato što pokušavate da se povežete na ADB server sa drugom verzijom. Samo pokušajte da pronađete adb binarni fajl koji softver koristi (idite na C:\Program Files\Genymobile\Genymotion i potražite adb.exe)
Nekoliko uređaja
Kada god pronađete several devices connected to your machine moraćete da specifikujete u kojem želite da pokrenete adb komandu.
U slučaju da je adbport dostupan samo sa localhost na android uređaju, ali imate pristup putem SSH, možete proslediti port 5555 i povezati se putem adb:
Ispisuje sve pakete, opcionalno samo one čije ime paketa sadrži tekst u <FILTER>.
adb shell pm list packages [options] <FILTER-STR>
adbshellpmlistpackages<FILTER-STR>adbshellpmlistpackages-f<FILTER-STR>#See their associated file.adbshellpmlistpackages-d<FILTER-STR>#Filter to only show disabled packages.adbshellpmlistpackages-e<FILTER-STR>#Filter to only show enabled packages.adbshellpmlistpackages-s<FILTER-STR>#Filter to only show system packages.adbshellpmlistpackages-3<FILTER-STR>#Filter to only show third party packages.adbshellpmlistpackages-i<FILTER-STR>#See the installer for the packages.adbshellpmlistpackages-u<FILTER-STR>#Also include uninstalled packages.adbshellpmlistpackages--user<USER_ID><FILTER-STR>#The user space to query.
adb shell pm path <PACKAGE>
Ispisuje putanju do APK-a datog .
adbshellpmpathcom.android.phone
adb shell pm clear <PACKAGE>
Obriši sve podatke povezane sa paketom.
adbshellpmclearcom.test.abc
File Manager
adb pull <remote> [local]
Preuzmite određenu datoteku sa emulatora/uređaja na vaš računar.
adbpull/sdcard/demo.mp4./
adb push <local> <remote>
Otpremite određenu datoteku sa vašeg računara na emulator/uređaj.
adbpushtest.apk/sdcard
Screencapture/Screenrecord
adb shell screencap <filename>
Uzima snimak ekrana prikaza uređaja.
adbshellscreencap/sdcard/screen.png
adb shell screenrecord [options] <filename>
Snima prikaz uređaja koji koriste Android 4.4 (API nivo 19) i novije verzije.
adbshellscreenrecord/sdcard/demo.mp4adbshellscreenrecord--size<WIDTHxHEIGHT>adbshellscreenrecord--bit-rate<RATE>adb shell screenrecord --time-limit <TIME> #Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes).
adbshellscreenrecord--rotate# Rotates 90 degreesadbshellscreenrecord--verbose
(pritiskom na Ctrl-C zaustavite snimanje)
Možete preuzeti datoteke (slike i video zapise) koristeći _adb pull_
Shell
adb shell
Dobijte shell unutar uređaja
adbshell
adb shell <CMD>
Izvršite komandu unutar uređaja
adbshellls
pm
Sledeće komande se izvršavaju unutar shell-a
pmlistpackages#List installed packagespmpath<packagename>#Get the path to the apk file of tha packageamstart [<options>] #Start an activity. Whiout options you can see the help menuamstartservice [<options>] #Start a service. Whiout options you can see the help menuambroadcast [<options>] #Send a broadcast. Whiout options you can see the help menuinput [text|keyevent]#Send keystrokes to device
Procesi
Ako želite da dobijete PID procesa vaše aplikacije, možete izvršiti:
adbshellps
И претражите вашу апликацију
Или можете да урадите
adbshellpidofcom.your.application
I odštampati PID aplikacije
Sistem
adbroot
Ponovo pokreće adbd daemon sa root dozvolama. Zatim, morate ponovo da se povežete na ADB server i bićete root (ako je dostupno)
adbsideload<update.zip>
flashing/restoring Android update.zip paketa.
Logs
Logcat
Da filtrirate poruke samo jedne aplikacije, dobijte PID aplikacije i koristite grep (linux/macos) ili findstr (windows) da filtrirate izlaz logcat-a:
adblogcat|grep4526adblogcat|findstr4526
adb logcat [option] [filter-specs]
adblogcat
Notes: pritisnite Ctrl-C da zaustavite monitor
adblogcat*:V# lowest priority, filter to only show Verbose leveladblogcat*:D# filter to only show Debug leveladblogcat*:I# filter to only show Info leveladblogcat*:W# filter to only show Warning leveladblogcat*:E# filter to only show Error leveladblogcat*:F# filter to only show Fatal leveladblogcat*:S# Silent, highest priority, on which nothing is ever printed
adb logcat -b <Buffer>
adblogcat-b# radio View the buffer that contains radio/telephony related messages.adblogcat-b# event View the buffer containing events-related messages.adblogcat-b# main defaultadblogcat-c# Clears the entire log and exits.adblogcat-d# Dumps the log to the screen and exits.adblogcat-ftest.logs# Writes log message output to test.logs .adblogcat-g# Prints the size of the specified log buffer and exits.adblogcat-n<count># Sets the maximum number of rotated logs to <count>.
Napravite rezervnu kopiju Android uređaja putem adb.
adbbackup [-apk] [-shared] [-system] [-all] -f file.backup# -apk -- Include APK from Third partie's applications# -shared -- Include removable storage# -system -- Include system Applciations# -all -- Include all the applicationsadbshellpmlistpackages-f-3#List packagesadbbackup-fmyapp_backup.ab-apkcom.myapp# backup on one deviceadbrestoremyapp_backup.ab# restore to the same or any other device