ADB Commands
Adb befindet sich normalerweise in:
Informationen erhalten von: http://adbshell.com/
Verbindung
Dies listet die verbundenen Geräte auf; wenn "unauthorisiert" erscheint, bedeutet dies, dass Sie Ihr Mobilgerät entsperren und die Verbindung akzeptieren müssen.
Dies zeigt dem Gerät an, dass es einen adb-Server auf Port 5555 starten muss:
Verbinde dich mit dieser IP und diesem Port:
Wenn Sie einen Fehler wie den folgenden in einer virtuellen Android-Software (wie Genymotion) erhalten:
Es liegt daran, dass Sie versuchen, sich mit einem ADB-Server einer anderen Version zu verbinden. Versuchen Sie einfach, die adb-Binärdatei zu finden, die die Software verwendet (gehen Sie zu C:\Program Files\Genymobile\Genymotion
und suchen Sie nach adb.exe)
Mehrere Geräte
Wann immer Sie mehrere Geräte, die mit Ihrem Computer verbunden sind finden, müssen Sie angeben, in welchem Sie den adb-Befehl ausführen möchten.
Port Tunneling
Falls der adb Port nur von localhost auf dem Android-Gerät zugänglich ist, aber Sie über SSH Zugriff haben, können Sie den Port 5555 weiterleiten und sich über adb verbinden:
Paketmanager
Installieren/Deinstallieren
adb install [option] <path>
adb deinstallieren [Optionen] <PAKET>
Pakete
Gibt alle Pakete aus, optional nur diejenigen, deren Paketname den Text in <FILTER> enthält.
adb shell pm list packages [options] <FILTER-STR>
adb shell pm path <PACKAGE>
Gibt den Pfad zur APK des angegebenen Pakets aus.
adb shell pm clear <PACKAGE>
Löscht alle mit einem Paket verbundenen Daten.
Dateimanager
adb pull <remote> [local]
Lädt eine bestimmte Datei von einem Emulator/ Gerät auf Ihren Computer herunter.
adb push <local> <remote>
Laden Sie eine bestimmte Datei von Ihrem Computer auf einen Emulator/ ein Gerät hoch.
Screencapture/Screenrecord
adb shell screencap <filename>
Ein Screenshot des Gerätdisplays aufnehmen.
adb shell screenrecord [options] <filename>
Aufzeichnen des Displays von Geräten, die Android 4.4 (API-Stufe 19) und höher ausführen.
(Drücken Sie Strg-C, um die Aufnahme zu stoppen)
Sie können die Dateien (Bilder und Videos) mit _adb pull_ herunterladen**
Shell
adb shell
Erhalten Sie eine Shell im Gerät
adb shell <CMD>
Führen Sie einen Befehl auf dem Gerät aus
pm
Die folgenden Befehle werden innerhalb einer Shell ausgeführt
Prozesse
Wenn Sie die PID des Prozesses Ihrer Anwendung erhalten möchten, können Sie ausführen:
Und suchen Sie nach Ihrer Anwendung
Oder Sie können tun
Und es wird die PID der Anwendung ausgeben
System
Restartet den adbd-Daemon mit Root-Rechten. Dann müssen Sie sich erneut mit dem ADB-Server verbinden und Sie werden Root sein (sofern verfügbar).
flashing/restoring Android update.zip Pakete.
Logs
Logcat
Um die Nachrichten nur einer Anwendung zu filtern, erhalten Sie die PID der Anwendung und verwenden Sie grep (linux/macos) oder findstr (windows), um die Ausgabe von logcat zu filtern:
adb logcat [option] [filter-specs]
Notes: Drücken Sie Ctrl-C, um die Überwachung zu stoppen
adb logcat -b <Buffer>
dumpsys
Systemdaten dumpen
adb shell dumpsys [options]
Notes: Ein mobiles Gerät mit aktivierten Entwickleroptionen, das Android 5.0 oder höher ausführt.
Hinweise: Battery Historian konvertiert diese Daten in eine HTML-Visualisierung. SCHRITT 1 adb shell dumpsys batterystats > batterystats.txt SCHRITT 2 python historian.py batterystats.txt > batterystats.html
adb shell dumpsys activity
Backup
Sichern Sie ein Android-Gerät von adb.
Wenn Sie den Inhalt des Backups inspizieren möchten:
Last updated