TouchDown

 View Only

How to Gather Android Device Logs Using Logcat with Android Studio 

Nov 23, 2015 11:49 AM

Command line method:

1. Download the stand-alone Android SDK Tools from http://developer.android.com/sdk/index.html#Other 

2. Follow http://developer.android.com/tools/help/logcat.html

Using Android Studio and Device Monitor:

    1.  Download and install the ADB drivers required for the device.  These drivers may be found on the device manufacture website.  For Google products such as the Nexus go to: http://developer.android.com/tools/extras/oem-usb.html

    2.  Activate USB Debugging mode by browsing to Settings > Android Developer and enable USB Debugging.

Note: To enable Developer mode on some Android devices go to Settings > About phone and repeatedly tap the “Build number” until developer mode is enabled.  For additional instructions for your device refer to http://developer.android.com/tools/device.html#setting-up

    3.  Download and install Android Studio from http://developer.android.com/sdk/index.html

    4.  From within Android studio go to Tools > Android > Android Device Monitor

Note: If not device monitor is available return to http://developer.android.com/sdk/index.html#Other and download SDK Tools.

    5.  Plug the USB cable from the workstation into the device.  It is important to accept any prompts to trust the computer.  Once the device is detected it will show as “Online”:

online.PNG

 

Note: If the device is not showing up as online then confirm USB Debugging is turned on, unplug the USB cable and plug it back in.  If the device is not showing up at all, confirm that its SDK was properly installed and that the USB connection is good.

    6. Click the “LogCat” tab to view the device logs:

Capture.PNG

For more details see http://developer.android.com/sdk/index.html

 

Example Logs:

11-20 17:43:10.125: D/ConnectivityService(561): reportBadNetwork(NetworkAgentInfo [WIFI () - 126]) by 10008
11-20 17:43:10.134: D/ConnectivityService(561): setProvNotificationVisibleIntent: E visible=false networkType=0 extraInfo=null
11-20 17:43:10.134: D/ConnectivityService(561): sendStickyBroadcast: action=android.net.conn.INET_CONDITION_ACTION
11-20 17:43:10.140: D/ConnectivityService(561): NetworkAgentInfo [WIFI () - 126] EVENT_NETWORK_INFO_CHANGED, going from CONNECTED to DISCONNECTED
11-20 17:43:10.140: D/ConnectivityService(561): NetworkAgentInfo [WIFI () - 126] got DISCONNECTED, was satisfying 3
11-20 17:43:10.298: D/ConnectivityService(561): notifyType LOST for NetworkAgentInfo [WIFI () - 126]
11-20 17:43:10.299: D/CSLegacyTypeTracker(561): Sending disconnected broadcast for type 1 NetworkAgentInfo [WIFI () - 126] isDefaultNetwork=true
11-20 17:43:10.299: D/ConnectivityService(561): sendStickyBroadcast: action=android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE
11-20 17:43:10.299: D/ConnectivityService(561): sendStickyBroadcast: action=android.net.conn.CONNECTIVITY_CHANGE
11-20 17:43:10.300: D/ConnectivityService(561): sendStickyBroadcast: action=android.net.conn.CONNECTIVITY_CHANGE_IMMEDIATE
11-20 17:43:10.307: D/ConnectivityService(561): sendStickyBroadcast: action=android.net.conn.CONNECTIVITY_CHANGE
11-20 17:43:10.313: D/ConnectivityService(561): Checking for replacement network to handle request NetworkRequest [ id=1, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ]
11-20 17:43:10.317: E/ConnectivityService(561): EVENT_NETWORK_INFO_CHANGED from unknown NetworkAgent
11-20 17:43:10.356: I/ActivityManager(561): Start proc 12482:com.android.mms/u0a16 for broadcast com.android.mms/.transaction.MmsSystemEventReceiver
11-20 17:43:10.404: D/CountryDetector(561): The first listener is added
11-20 17:43:10.487: I/ActivityManager(561): Start proc 12510:com.google.android.apps.gcs/u0a28 for broadcast com.google.android.apps.gcs/.steen.receiver.ConnectivityChangeReceiver
11-20 17:43:10.498: W/ResourcesManager(12482): Asset path '/system/framework/com.google.android.media.effects.jar' does not exist or contains no resources.
11-20 17:43:10.513: I/ActivityManager(561): Killing 25789:android.process.acore/u0a4 (adj 15): empty #17
11-20 17:43:10.836: I/ActivityManager(561): Killing 11635:com.android.musicfx/u0a17 (adj 15): empty #17
11-20 17:43:11.020: I/ActivityManager(561): Start proc 12541:com.google.android.apps.magazines/u0a64 for broadcast com.google.android.apps.magazines/com.google.apps.dots.android.newsstand.appwidget.NewsWidgetProvider
11-20 17:43:11.112: W/ActivityManager(561): getRunningAppProcesses: caller 10064 does not hold REAL_GET_TASKS; limiting output
11-20 17:43:11.199: W/ActivityManager(561): getRunningAppProcesses: caller 10064 does not hold REAL_GET_TASKS; limiting output
11-20 17:43:11.610: W/ActivityManager(561): getRunningAppProcesses: caller 10064 does not hold REAL_GET_TASKS; limiting output
11-20 17:43:11.617: W/ActivityManager(561): getRunningAppProcesses: caller 10064 does not hold REAL_GET_TASKS; limiting output
11-20 17:43:11.672: I/ActivityManager(561): Start proc 12598:com.android.chrome/u0a32 for broadcast com.android.chrome/org.chromium.chrome.browser.precache.PrecacheServiceLauncher
11-20 17:43:11.674: I/ActivityManager(561): Killing 10955:com.android.defcontainer/u0a5 (adj 15): empty #17
11-20 17:43:11.922: I/ActivityManager(561): Start proc 12617:com.google.android.apps.photos/u0a70 for broadcast com.google.android.apps.photos/.actionqueue.SystemReceiver
11-20 17:43:11.923: I/ActivityManager(561): Killing 11655:com.android.keychain/1000 (adj 15): empty #17
11-20 17:43:12.507: I/ActivityManager(561): Killing 11730:com.google.android.apps.docs/u0a44 (adj 15): empty #17
11-20 17:43:12.507: I/ActivityManager(561): --------- beginning of crash
11-20 17:43:15.388: E/AndroidRuntime(3802): FATAL EXCEPTION: main
11-20 17:43:15.388: E/AndroidRuntime(3802): Process: com.symantec.mobilitysuite.mdm, PID: 3802
11-20 17:43:15.388: E/AndroidRuntime(3802): android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:734)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1676)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1655)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at com.odysseysoftware.android.athena.host.an.a(Unknown Source)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at com.odysseysoftware.android.athena.host.an.a(Unknown Source)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at com.odysseysoftware.android.athena.host.ap.a(Unknown Source)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at com.odysseysoftware.android.athena.host.as.run(Unknown Source)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.os.Handler.handleCallback(Handler.java:739)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.os.Handler.dispatchMessage(Handler.java:95)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.os.Looper.loop(Looper.java:135)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at android.app.ActivityThread.main(ActivityThread.java:5254)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at java.lang.reflect.Method.invoke(Native Method)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at java.lang.reflect.Method.invoke(Method.java:372)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
11-20 17:43:15.388: E/AndroidRuntime(3802): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
11-20 17:43:15.414: W/ActivityManager(561):   Force finishing activity 1 com.symantec.mobilitysuite.mdm/com.odysseysoftware.android.athena.mdmadmin.AgentCleanUpActivity
11-20 17:43:15.475: I/WindowState(561): WIN DEATH: Window{16f86ab u0 com.symantec.mobilitysuite.mdm/com.odysseysoftware.android.athena.mdmadmin.AgentCleanUpActivity}
11-20 17:43:15.476: D/WifiService(561): Client connection lost with reason: 4
11-20 17:43:15.478: I/WindowState(561): WIN DEATH: Window{1f43709b u0 com.symantec.mobilitysuite.mdm/com.odysseysoftware.android.athena.mdmadmin.AgentCleanUpActivity}
11-20 17:43:15.583: I/ActivityManager(561): Process com.symantec.mobilitysuite.mdm (pid 3802) has died
11-20 17:43:15.583: W/ActivityManager(561): Scheduling restart of crashed service com.symantec.mobilitysuite.mdm/com.odysseysoftware.android.athena.host.HostService in 1000ms
11-20 17:43:16.650: I/ActivityManager(561): Start proc 12680:com.symantec.mobilitysuite.mdm/u0a96 for service com.symantec.mobilitysuite.mdm/com.odysseysoftware.android.athena.host.HostService
11-20 17:44:10.378: D/ConnectivityService(561): Failed to find a new network - expiring NetTransition Wakelock
11-20 17:44:31.400: D/WifiService(561): acquireWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@7698243}
11-20 17:44:32.171: D/WifiService(561): releaseWifiLockLocked: WifiLock{NlpWifiLock type=2 binder=android.os.BinderProxy@7698243}
11-20 17:44:34.930: D/ConnectivityService(561): registerNetworkAgent NetworkAgentInfo{ ni{[type: WIFI[], state: CONNECTING/CONNECTING, reason: (unspecified), extra: "SYMC-MyWiFi", roaming: false, failover: false, isAvailable: true, isConnectedToProvisioningNetwork: false]}  network{null}  lp{{InterfaceName: wlan0 LinkAddresses: []  Routes: [] DnsAddresses: [] Domains: null MTU: 0 TcpBufferSizes: 524288,1048576,2097152,262144,524288,1048576}}  nc{[ Transports: WIFI Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps]}  Score{20}  everValidated{false}  lastValidated{false}  created{false}  explicitlySelected{false} }
11-20 17:44:34.930: D/ConnectivityService(561): NetworkAgentInfo [WIFI () - 127] EVENT_NETWORK_INFO_CHANGED, going from null to CONNECTING
11-20 17:44:37.184: W/LocationBasedCountryDetector(561): Exception occurs when getting country from location
11-20 17:44:40.620: D/ConnectivityService(561): NetworkAgentInfo [WIFI () - 127] EVENT_NETWORK_INFO_CHANGED, going from CONNECTING to CONNECTED
11-20 17:44:40.622: D/ConnectivityService(561): Adding iface wlan0 to network 127
11-20 17:44:40.662: E/ConnectivityService(561): Unexpected mtu value: 0, wlan0
11-20 17:44:40.662: D/ConnectivityService(561): Adding Route [fe80::/64 -> :: wlan0] to network 127
11-20 17:44:40.667: D/ConnectivityService(561): Adding Route [10.17.60.0/22 -> 0.0.0.0 wlan0] to network 127
11-20 17:44:40.668: D/ConnectivityService(561): Adding Route [0.0.0.0/0 -> 10.17.60.1 wlan0] to network 127
11-20 17:44:40.669: D/ConnectivityService(561): Setting Dns servers for network 127 to [/155.64.67.70, /155.64.226.72, /155.64.67.84, /155.64.80.241]
11-20 17:44:40.689: D/ConnectivityService(561): notifyType IP_CHANGED for NetworkAgentInfo [WIFI () - 127]
11-20 17:44:40.699: D/ConnectivityService(561): notifyType PRECHECK for NetworkAgentInfo [WIFI () - 127]
11-20 17:44:40.699: D/ConnectivityService(561): rematching NetworkAgentInfo [WIFI () - 127]
11-20 17:44:40.699: D/ConnectivityService(561):    accepting network in place of null
11-20 17:44:40.700: D/ConnectivityService(561): Switching to new default network: NetworkAgentIn

 

Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
pdf file
How to gather Android device logs using Android Studio an....pdf   372 KB   1 version
Uploaded - Mar 16, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.