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.

 

 

 

 

 

About Author

Author Image
Rahul Baboria

Rahul Baboria is having good knowledge over Android Application.

Request for Proposal

Name is required

Comment is required

Sending message..