Reading logs with ADB: the most useful commands
Last updated: March 25, 2020
Reading logs during testing Android applications often force developer or tester to use appropriate tools. One of them is: Android Device Bridge. ADB comes as a part of the standard Android SDK, it provides a terminal-based interface for interacting with your devices with Android file system. Below I added some useful commands that every tester, programmer use during deal with applications every day.
Useful commands:
- access to Android device logs, direct output to the console
- this command allows to save logs in a file name you have specified, for example: abd logcat -d Users/user/storage
- logs on devices are erased, after that you are able to grab logs without unnecessary data
- display logs with specified time
- reboot device
- ensure that there is a server running
- kill the server if it is running
- push apps from comupter onto device
-
prints: offline bootloader device
- prints: serial-number
- continuously print device status for a specified device
- remounts the /system partition on the device read-write
- reboots the device, optionally into the bootloader or recovery program
- restarts the adbd daemon listening on TCP on the specified port
- list PIDs of processes hosting a JDWP transport
- run PPP over USB Note: you should not automatically start a PPP connection. refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1 [parameters] – Eg. defaultroute debug dump local notty usepeerdns
- above command will start an interactive shell from your machine, but running on your device
- deleting existing apps on SD
- return all information from the device that should be included in a bug report
- unlock bootloader, making root access possible
- flash a custom recovery image to your phone
- starting application using adb tools
or
- to connect to device via wifi using adb commands
- to print all packages
- to see their associated APK file
- to check show enabled packages
- to show the package UID
- to displayed routing table
- to displayed all socets
- to displayed listening server sockets
- to display IP adress
Reference:
My site is free of ads and trackers. Was this post helpful to you? Why not
Disqus is great for comments/feedback but I had no idea it came with these gaudy ads.