ADB Commands
Adb is gewoonlik geleë in:
Inligting verkry van: http://adbshell.com/
Verbinding
Dit sal die gekonnekte toestelle lys; as "onbevoeg" verskyn, beteken dit dat jy jou mobiele moet ontsluit en die verbinding moet aanvaar.
Dit dui aan die toestel aan dat dit 'n adb-bediener op poort 5555 moet begin:
Verbind met daardie IP en daardie Poort:
As jy 'n fout soos die volgende in 'n Virtuele Android-sagteware (soos Genymotion) kry:
Dit is omdat jy probeer om met 'n ADB-bediener van 'n ander weergawe te verbind. Probeer net om die adb-binary te vind wat die sagteware gebruik (gaan na C:\Program Files\Genymobile\Genymotion
en soek vir adb.exe)
Verskeie toestelle
Wanneer jy verskeie toestelle wat aan jou masjien gekoppel is vind, sal jy moet spesifiseer in watter een jy die adb-opdrag wil uitvoer.
Port Tunneling
In die geval waar die adb poort slegs toeganklik is vanaf localhost op die Android-toestel, maar jy het toegang via SSH, kan jy die poort 5555 voordeur en via adb aansluit:
Pakketbestuurder
Installeer/Verwyder
adb install [opsie] <pad>
adb uninstall [options] <PACKAGE>
Pakkette
Druk alle pakkette af, opsioneel slegs dié waarvan die pakketaan naam die teks in <FILTER> bevat.
adb shell pm list packages [options] <FILTER-STR>
adb shell pm path <PACKAGE>
Druk die pad na die APK van die gegewe .
adb shell pm clear <PACKAGE>
Verwyder alle data wat met 'n pakket geassosieer is.
File Manager
adb pull <remote> [local]
Laai 'n spesifieke lêer van 'n emuleerder/toestel na jou rekenaar af.
adb push <local> <remote>
Laai 'n spesifieke lêer van jou rekenaar na 'n emuleerder/toestel op.
Screencapture/Screenrecord
adb shell screencap <filename>
Neem 'n skermskoot van 'n toestel se skerm.
adb shell screenrecord [options] <filename>
Opname van die skerm van toestelle wat Android 4.4 (API-vlak 19) en hoër draai.
(druk Ctrl-C om opnames te stop)
Jy kan die lêers (beelde en video's) aflaai met _adb pull_
Shell
adb shell
Kry 'n shell binne die toestel
adb shell <CMD>
Voer 'n opdrag binne die toestel uit
pm
Die volgende opdragte word binne 'n skulp uitgevoer
Processes
As jy die PID van die proses van jou aansoek wil kry, kan jy uitvoer:
En soek vir jou aansoek
Of jy kan doen
En dit sal die PID van die aansoek druk
Stelsel
Herstart die adbd daemon met worteltoestemmings. Dan moet jy weer aan die ADB-bediener koppel en jy sal wortel wees (indien beskikbaar)
flashing/restoring Android update.zip pakkette.
Logs
Logcat
Om slegs die boodskappe van een toepassing te filter, kry die PID van die toepassing en gebruik grep (linux/macos) of findstr (windows) om die uitvoer van logcat te filter:
adb logcat [opsie] [filter-spesifikasies]
Notes: druk Ctrl-C om monitor te stop.
adb logcat -b <Buffer>
dumpsys
dump stelseldat
adb shell dumpsys [options]
Notas: 'n Mobiele toestel met Ontwikkelaaropsies geaktiveer wat Android 5.0 of hoër draai.
Notas: Battery Historian omskep daardie data in 'n HTML-visualisering. STAP 1 adb shell dumpsys batterystats > batterystats.txt STAP 2 python historian.py batterystats.txt > batterystats.html
adb shell dumpsys activity
Rugsteun
Rugsteun 'n Android-toestel vanaf adb.
As jy die inhoud van die rugsteun wil inspekteer:
Last updated