Skip to content

Latest commit

 

History

History
76 lines (48 loc) · 2.29 KB

README.md

File metadata and controls

76 lines (48 loc) · 2.29 KB

Debugging Operations

These operations are for a more technical use since we are going to be able to export a bug report, work with device states, remount the partitions, reboot and enter as root.

Export Bug Report (adb bugreport path)
int export_bugreport(char* device, char* port, char* path, int stdout_fd, int stderr_fd);

This function allows us to write the device bug reports to the path, the path can be a directory or a file path (.zip file).

Wait for State (adb wait-for-transport-state)
int wait_for_state(char* device, char* port, char* state, char* transport, int stdout_fd, int stderr_fd);

This function waits for device to be in the given state (device, recovery, rescue, sideload, bootloader, disconnect) using the given transport (usb, local, any).

Get State (adb get-state)
int get_state(char* device, char* port, int stdout_fd, int stderr_fd);

Sends through the stdout the device state.

Get Serial Number (adb get-serialno)
int get_serialnumber(char* device, char* port, int stdout_fd, int stderr_fd);

Sends through the stdout the device serial number.

Get Device Path (adb get-devpath)
int get_devicepath(char* device, char* port, int stdout_fd, int stderr_fd);

Sends through the stdout the device path.

Remount Partitions (adb remount)
int remount_partitions(char* device, char* port, int reboot, int stdout_fd, int stderr_fd);

Remounts the device partitions read-write, if reboot=1, the device is going to be rebooted after the remount operation.

Reboot Device (adb reboot mode)
int reboot_atmode(char* device, char* port, char* mode, int stdout_fd, int stderr_fd);

Reboots the device into the selected mode, the mode can be bootloader, recovery, sideload, sideload-auto-reboot.

Root Mode (adb root, adb unroot)
int enter_root(char* device, char* port, int stdout_fd, int stderr_fd);
int exit_root(char* device, char* port, int stdout_fd, int stderr_fd);

The first function restarts ADB with root permissions (Device should be rooted) and the second function restarts ADB without root permissions.

USB Mode (adb usb)
int listen_usb(char* device, char* port, int stdout_fd, int stderr_fd);

Restarts the ADB listening on USB instead of the TCP/IP connection.