LogShark is a simple utility to collect logs from an Android device using a PC.
I created this to help Android developers collect information from their app's users. This information can be very useful for debugging purposes.
From Android version 4.1 (Jelly Bean) onwards, it has become difficult to collect this information through the device itself. Hence the need for an app that runs on the PC.
Note that the collection of information is entirely voluntary. Moreover, the user can (and should) review the information before sending it to developers or other people.
Install the latest version of Java from java.com
To do this, go to Settings
-> Developer Options
and turn the developer options on.
If Developer options
is not available, you may need to research how to enable this option on your particular phone. The Nexus 4, for example, requires 7 taps on the Build Number to enable Developer Options
If you are using Microsoft Windows, you need to setup some USB drivers. See WindowsSetup
below.
On other operating systems, no further setup is required.
Download the LogShark
jar file from here and save to any folder.
(Note for those unfamiliar with Java: you don't need to extract this file. The file is a fully self-contained Java executable).
Connect your Android device to your PC using a USB cable. A notification should appear that says "USB debugging connected".
Now start the LogShark application. On Windows, you can simply double-click the jar file from an Explorer window. Similar interfaces should be available on other OSes.
If you prefer the command line, you can invoke it like this:
java -jar LogShark_0.1.jar
You should now see a window that explains what is happening. Upon successful completion, a file called logSharkOut.txt
should be created. This file contains the log history of the Android device.
On Android 4.1+ devices, a prompt will be shown on the device to authorize the connection. You need to accept this authorization for LogShark
to function.
On Windows you need to do some extra configuration.
First, download and install this app called zadig
. This app allows you install libusbx
device drivers for a specific USB device.
Windows XP users should download zadig_xp
Windows Vista, Win 7, Win 8 users should download zadig
After downloading the above, connect your Android device and run the zadig
application. In the zadig
main window select your Android device and select WinUSB (v6.1.xxx)
and then click Install Driver
.
That's it!
Now, LogShark
should be able to work with your Android device.
First cut.
- Filtering by verbosity (error, debug, etc)
- Filtering by app, tag, time, etc.
- Open-source
Exception in thread "main" java.lang.NullPointerException
at de.ailis.usb4java.AbstractIrpQueue.add(AbstractIrpQueue.java:75)
at de.ailis.usb4java.Pipe.asyncSubmit(Pipe.java:197)
at de.ailis.usb4java.Pipe.asyncSubmit(Pipe.java:175)
at de.ailis.usb4java.Pipe.syncSubmit(Pipe.java:161)
at logshark.ADBRx.rcvData(ADB.scala:194)
at logshark.ADBRx.rcvMessage(ADB.scala:163)
at logshark.AdbManager.readStream(AdbManager.scala:138)
at logshark.Main$$anonfun$readLogs$1.apply(Main.scala:93)
at logshark.Main$$anonfun$readLogs$1.apply(Main.scala:91)
at scala.Option.map(Option.scala:145)
at logshark.Main$.readLogs(Main.scala:91)
at logshark.Main$.main(Main.scala:63)
at logshark.Main.main(Main.scala)