Get the Android phone log

Method 1: Use a USB connection

1, enable USB debugging on the phone
2, the input terminaladb devices

 

 

3, get logs

  • Only one device is connected:
    1) to clear the cached log: adb logcat -c
    2) and saves it to the log acquired: adb logcat >~/Desktop/a.txt (local directory definable)
    3) press Ctrl + C in the terminal log acquisition stop
  • Connecting a plurality of devices:
    1) to clear the cached log: adb -s device_list logcat -c
    2) and saves it to the log acquired: adb logcat >~/Desktop/a.txt (local directory definable)
    3) press Ctrl + C in the terminal log acquisition stop

Second way: using a wireless WiFi connection

1. Connect your phone to a computer
2, set the port, and 5555 is the default port:adb tcpip port

3, the mobile phone and computer is disconnected

4, computers and mobile phones connected to the same network, the wireless connection mobile phone, ip phone connection IP, port to port step of the setup:adb connect ip:port

5, get logs (Note: When the phone is not on the same network and the computer will automatically log for port stop)

  • Acquiring the log
    1) to clear the cached log: adb logcat -c
    2) and saves it to the log acquired: adb logcat >~/Desktop/a.txt (local directory definable)
    3) press Ctrl + C in the terminal log acquisition stop

6, cancel the connection:adb disconnect ip:port

Guess you like

Origin www.cnblogs.com/91parson/p/11701481.html