Facebook Stetho as Debugging Bridge Android
Posted By : Rahul Baboria | 01-Sep-2017
To Integrate Facebook Stetho :
Add dependency or download jar form here
Gradle:
'compile 'com.facebook.stetho:stetho:1.5.0'
As a network Helper:
'compile 'com.facebook.stetho:stetho-okhttp3:1.5.0'
Maven:
1
2
3
4
5
|
<dependency>
<groupId>com.facebook.stetho</groupId>
<artifactId>stetho</artifactId>
<version>1.5.0</version>
</dependency>
|
Modify onCreate Method of Application class as :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Stetho.InitializerBuilder initializerBuilder =
Stetho.newInitializerBuilder(this);
initializerBuilder.enableWebKitInspector(
Stetho.defaultInspectorModulesProvider(this)
);
initializerBuilder.enableDumpapp(
Stetho.defaultDumperPluginsProvider(singleton)
);
Stetho.Initializer initializer = initializerBuilder.build();
Stetho.initialize(initializer);
}
}
|
What you can do with this ?
1. Inspect network connections GET or POST
2. Inspect SQLite Database and edit files also.
3. Inspect Shared Preferences and edit files also.
4. Integrate with JavaScript console to write a code and interact with application.
5. See the views hierarchy in application.
6. Using Dumpapp which can allow you which allows you to manipulate app using command line.
7. Create custom dumpapp plugins.
How to Inspect:
To inspect your application. Install application and connect your android device to computer. Then start Google Chrome as it is a chrome tool .
Click on more tools > Developer tools > Remote Devices
It will show your mobile name and application running and you can inspect it by clicking inspect button.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Rahul Baboria
Rahul Baboria is having good knowledge over Android Application.