adb -d logcat -d > log_dump.txt
- Write the current Android device logs to the file.
- The first
-d
applies toadb
and means "the only connected device". - The second
-d
applies tologcat
and means "dump the contents and exit".
adb -s CAFEBABEDEADBEEF logcat -d > log_dump.txt
- Same as previous, but connect to the device with the given serial number.
adb shell "pm list packages"
- Prints the list of packages installed on the device.
adb shell "cmd package list packages -f"
- Prints the list of packages installed, along with the location of the apk.
adb shell "cmd package query-activities -a android.intent.action.MAIN -c android.intent.category.LAUNCHER"
- Dumps the information about every activity that is shown in the launcher (i.e., has the launcher intent).
adb shell "am start -n "com.bignerdranch.android.reversible/.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER"
- Starts the activity specified by the
-n
parameter with the launcher action/category (MAIN
/LAUNCHER
).
adb shell "am start -a android.intent.action.VIEW -d 'https://www.bignerdranch.com'"
- Starts the
VIEW
(action specified by-a
) intent with the URL specified by-d
(data).