One. Use the ADB command to view
Open a command window and go to Platform-tools in the Android SDK directory to execute the command:
1. Input: Under Windows: adb shell under Linux: ./adb Shell
2. Enter Data/data: If the phone does not have root, use the command Run-as package name to go directly to/data/data
3. Go to databases: CD databases
4. Use the ls command to list all databases in the current directory
5. Use the sqlite3 database name
6. Finally, you can execute the corresponding SQL statement, note that after the SQL statement, add a semicolon
Note: If you want the ADB command to be available in any directory, just configure its environment variables (as per the method of configuring the JDK)
Some phones may not find the package name using the run-as package name command (not resolved), and some phones cannot find the sqlite3 command (not resolved)
Two. Using Facebook's Stetho
1. Search Stetho on GitHub to open the first Facebook/stetho
2. Open Build.gradle (Module:app) in Android Studio and enter it in dependencies
Compile ' com.facebook.stetho:stetho:1.3.1 '
There's a sync now on the top right.
3. Create a new class in the app with the following code:
Public class extends Application { publicvoid onCreate () { super. OnCreate (); Stetho.initializewithdefaults (this);} }
4. Configure the Name property of the application in manifests:
Android:name= ". MyApplication "
5. Finally enter the URL in the Chrome browser
Chrome://inspect (may require FQ)
6. Connect your phone to your computer, run the app, show the app's package name below devices, click the inspect below, and choose Resources,websql to see your app's database
Android uses ADB commands and Stetho to view the app database