Files
oam/knowledge base/android.md
2023-05-25 23:55:23 +02:00

1.7 KiB

Android

Table of contents

  1. TL;DR
  2. Further readings
  3. Sources

TL;DR

# List attached devices.
adb devices
adb devices -l

# Download files from an attached device.
adb pull '/path/to/device/file.img'
adb -s 'device_serial' pull '/path/to/device/file.img' '/path/to/local/file.img'

# Upload files to an attached device.
adb push 'path/to/local/file.img' 'path/to/device/dir'

# Install an application.
adb install 'path/to/file.apk'
adb -s 'device_serial' install 'path/to/file.apk'

# Issue shell commands.
adb shell 'command'

# Reboot devices to their 'fastboot' mode.
adb reboot bootloader

# Reset `adb` on the local host.
adb kill-server

With the device in fastboot mode:

# List attached devices.
fastboot devices

# Unlock the bootloader.
fastboot flashing unlock
fastboot oem unlock

# Lock the bootloader.
fastboot flashing lock
fastboot oem lock

# Flash a recovery image.
fastboot flash recovery 'path/to/recovery.img'

# Flash a boot image.
fastboot flash boot 'path/to/boot.img'

# Reboot to 'system' mode.
fastboot reboot

Further readings

Sources

All the references in the further readings section, plus the following: