An Android library that boots an internal web server to display Android Logcat in your browser. You will never need to connect your cable again to debug or view logs.
- Does anyone on your team, who is not Android developer, need to view logs? Maybe back-end developers? They test webservices in Postman, SoapUI, Advanced REST Client... but they do not obtain the same results as with the APP? Why not test the APP directly? You only have to write logs to see them in the browser.
- Because you can integrate this ligthweight library and just run it into debug builds.
- Because you can unplug the debug cable and turn off adb commands.
- Because Android Studio Logcat window shows raw data.
When you add this library to your Android application, it enables a web server to allow access to getting Android Logcat info in real-time. You only need run some browser and request a query to IP direction of your device (like http://192.168.0.128:8080). Note that is necesary share the same network. Once you get the fist connection to /log path, automatically the content be reload frequently providing the latest changes. Remember that you can also filter the content using the search engine.
You only need to follow these 3 steps:
- Add this .AAR library to your app/libs folder.
- Add these lines to the app/build.gradle file.
repositories {
...
flatDir {
dirs 'libs'
}
}
...
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
...
//RemoteLogcat
compile(name: "remotelogcat_v1.1", ext: 'aar')
}
- Code this lines in your custom Application class or Activity.
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) { //avoid execution on release, it is only for testing purpoise
RemoteLogcatServer logcatServer
= new RemoteLogcatServer(
8080, //port to open connection
5000, //page reload rate (ms)
getApplicationContext()
);
logcatServer.startServer();
}
}
When you runs your APP, a default Android notification shows IP Address of your mobile phone to start conections. If you touch it, your browser opens welcome page to show tracked info from your Android Logcat.
I hope you enjoy it! Byee
- Automatic highlighting for JSON objects found in Logcat
- Automatic bold hightlighting for Retrofit request and response tags
- Manual bold hightlighting using #RemoteLogcatBold# tags
private static final String TAG_REMOTE_LOGCAT_BOLD = "#RemoteLogcatBold#";
Log.d("your_tag", TAG_REMOTE_LOGCAT_BOLD + "something to hightlight");
To expand the content formatting a pretty JSON object you must click on the header tag. In this case: "D/OkHttp" label.
Sorry, currently the content is not mobile responsive