An Open-sourced, On-device debugger for Android applications, which helps intercept Network calls, capture Crashes & ANRs, manipulate application data on-the-go, and much more.
It comes with a UI to monitor and share the information, as well as APIs to access and use that information in your application.
Integrate Pluto in your application
Pluto is distributed through jCenter. To use it, you need to add the following Gradle dependency to your build.gradle file of you android app module.
Note:
add both the pluto and the pluto-no-op variant to isolate Pluto from release builds.
debugImplementation 'com.mocklets:pluto:2.1.4' releaseImplementation'com.mocklets:pluto-no-op:2.1.4'
To integrate Pluto in your app, minimum required Android SDK version is 16.
Now to start using Pluto, intialize Pluto SDK from you application class by passing context to it.
Pluto.initialize(context)
🎉 That's it! You are all set.
To test the implementation, re-install the application and you will get the following notification from Pluto. Tap the notification to open the Pluto debug UI.
Sample App
Pluto is debugging Sample App
Tap here to view complete debug report
But you will not be able to see any data there. For that you have to enable individual features as per your requirement. Follow the following guide to enable features.
To debug HTTP requests/responses, plug the PlutoInterceptor in your OkHttp Client Builder
val client = OkHttpClient.Builder()
.addInterceptor(...)
.addInterceptor(PlutoInterceptor())
.build()
Pluto can capture and store potential ANRs occuring in the app. You can also listen to these ANRs and report these to any Crash reporting tools like Firebase Crashlytics, Bugsnag, etc.
Pluto.setANRListener(object: ANRListener { override fun onAppNotResponding(exception: ANRException) { exception.printStackTrace() PlutoLog.e(“ANR”, exception.threadStateMap) } })
Pluto allows you to log and persist the user journey through the app, and help debug them without any need to connect to Logcat.
PlutoLog.event("analytics", eventName, HashMap(attributes)) PlutoLog.d("debug_log", "button clicked") PlutoLog.e("error_log", "api call falied with http_status 400") PlutoLog.w("warning_log", "warning log") PlutoLog.i("info_log", "api call completed")
But if you are connected to Logcat, PlutoLogs behave similar to Log class, with an improvement to tag the method and file name also. In Logcat, PlutoLogs will look like the following.
D/onClick(MainActivity.kt:40) | debug_log: button clicked
E/onFailure(NetworkManager.kt:17) | error_log: api call falied with http_status 400
Pluto allows storing information like App status(like app configurations), User properties(like email, profile) and Device fingerprint(like IMEI).
This data can later be accessed via Pluto debug UI. This method can be called multiple times and it will keep on appending the data.
Pluto.setAppProperties(hashMapOf( "User id" to "2whdue-dn4f-3hr-dfhrhs", "User email" to "john.smith@gmail.com" ))