ChatGPT解决这个技术问题 Extra ChatGPT

View contents of database file in Android Studio

I have been using Android Studio to develop my app since it's was released.

Everything works nice until recently, I have to debug together with checking the database file. Since I don't know how to see the database directly, When I debugged to generate the database file, I have to export the database file from my phone to the PC.

In order to do this, I have to open DDMS > File Explorer. Once I open the DDMS, I have to reconnect the USB, and I lose my debug thread. After checking the database file, I have to close the DDMS and reconnect the USB again to get back to the debug mode.

It's just too complicated. Does anyone have a better way to do this in Android Studio (I know it's easier in Eclipse) ?

Now this feature is available Android Studio itself: developer.android.com/studio/inspect/database

O
Ojonugwa Jude Ochalifu

Viewing databases from Android Studio:

Option 1:

Download and install SQLiteBrowser. Copy the database from the device to your PC: Android Studio versions < 3.0: Open DDMS via Tools > Android > Android Device Monitor Click on your device on the left. You should see your application: Go to File Explorer (one of the tabs on the right), go to /data/data/databases Select the database by just clicking on it. Go to the top right corner of the Android Device Monitor window. Click on the 'pull a file from the device' button: A window will open asking you where you want to save your database file. Save it anywhere you want on your PC. Android Studio versions >= 3.0: Open Device File Explorer via View > Tool Windows > Device File Explorer Go to data > data > PACKAGE_NAME > database, where PACKAGE_NAME is the name of your package (it is com.Movie in the example above) Right click on the database and select Save As.... Save it anywhere you want on your PC. Now, open the SQLiteBrowser you installed. Click on 'open database', navigate to the location you saved the database file, and open. You can now view the contents of your database.

Option 2:

Go to this Github repository and follow the instructions in the readme to be able to view your database on your device. What you get is something like this:

https://i.stack.imgur.com/TBdDV.png

That's it. It goes without saying however that you should undo all these steps before publishing your app.


thats for me the correct answer because the hint with the sqlitebrowser tool, it's awesome. Thank's
/data doesn't expand in file explorer of Device Monitor, i guess its inaccessible since listing entries of /data or /data/data directory requires superUser access. I am still able to access my database files through adb shell with su privileges. Have any idea how to get su access in file manager?
@ZekeDran, yes the method only shows data from an emulator not your device.I have added steps to view the database on your device though.Check the edit
It works, but the emulator has to be running not more than API 23. If you use API 25, then there are no contents in the file explorer
The database manager from your Github link is working for me! It also has the opportunity to test queries!
D
Dheeraj Bhaskar

Connect to Sqlite3 via ADB Shell

I haven't found any way to do that in Android Studio, but I access the db with a remote shell instead of pulling the file each time.

Find all info here: http://developer.android.com/tools/help/adb.html#sqlite

1- Go to your platform-tools folder in a command prompt

2- Enter the command adb devices to get the list of your devices

C:\Android\adt-bundle-windows-x86_64\sdk\platform-tools>adb devices
List of devices attached
emulator-xxxx   device

3- Connect a shell to your device:

C:\Android\adt-bundle-windows-x86_64\sdk\platform-tools>adb -s emulator-xxxx shell

4- Navigate to the folder containing your db file:

cd data/data/<your-package-name>/databases/

5- run sqlite3 to connect to your db:

sqlite3 <your-db-name>.db

6- run sqlite3 commands that you like eg:

Select * from table1 where ...;

Note: Find more commands to run below.

SQLite cheatsheet

There are a few steps to see the tables in an SQLite database:

List the tables in your database: .tables List how the table looks: .schema tablename Print the entire table: SELECT * FROM tablename; List all of the available SQLite prompt commands: .help


i get permission denied at step 4, what do you think?
You may have to root your avd, and/or start adb as root at step 3 'root adb -s emulator-xxxx shell'
step 5: sqlite3 not found. Why?
Because you need to install in in order to use
I personnaly got Permission denied when trying to access the databases folder, running run-as your.package.name did the trick.
V
Vadim Kotov

I'm actually very surprised that no one has given this solution:

Take a look at Stetho.

I've used Stetho on several occasions for different purposes (one of them being database inspection). On the actual website, they also talk about features for network inspection and looking through the view hierarchy.

It only requires a little setup: 1 gradle dependency addition (which you can comment out for production builds), a few lines of code to instantiate Stetho, and a Chrome browser (because it uses Chrome devtools for everything).

Update: You can now use Stetho to view Realm files (if you're using Realm instead of an SQLite DB): https://github.com/uPhyca/stetho-realm

Update #2: You can now use Stetho to view Couchbase documents: https://github.com/RobotPajamas/Stetho-Couchbase

Update #3: Facebook is focusing efforts on adding all Stetho features into its new tool, Flipper. Flipper already has many of the features that Stetho has. So, now may be a good time to make the switch. https://fbflipper.com/docs/stetho.html


Thank a lot. To be more simple, 1.compile 'com.facebook.stetho:stetho:1.3.1' and 2. add this code Stetho.initializeWithDefaults(this); and 3. chrome://inspect/#devices
Very simple, you can see data from the database without 3rd party tools, inside chrome browser.
Don't forget Stetho.initializeWithDefaults(this); should be in the Application class.
Great tool. Your app will be listed on the #devices page if you've done the setup correctly. Click Inspect and then go to Resources > Web SQL > [db_name] and you can write your sqlite statements.
C
Community

Simplest method when not using an emulator

$ adb shell
$ run-as your.package.name
$ chmod 777 databases
$ chmod 777 databases/database_name
$ exit
$ cp /data/data/your.package.name/databases/database_name /sdcard
$ run-as your.package.name # Optional
$ chmod 660 databases/database_name # Optional
$ chmod 660 databases # Optional
$ exit # Optional
$ exit
$ adb pull /sdcard/database_name

Caveats:

I haven't tested this in a while. It may not work on API>=25. If the cp command isn't working for you try one of the following instead:

# Pick a writeable directory <dir> other than /sdcard
$ cp /data/data/your.package.name/databases/database_name <dir>

# Exit and pull from the terminal on your PC
$ exit
$ adb pull /data/data/your.package.name/databases/database_name

Explanation:

The first block configures the permissions of your database to be readable. This leverages run-as which allows you to impersonate your package's user to make the change.

$ adb shell
$ run-as your.package.name
$ chmod 777 databases
$ chmod 777 databases/database_name
$ exit # Closes the shell started with run-as

Next we copy the database to a world readable/writeable directory. This allows the adb pull user access.

$ cp /data/data/your.package.name/databases/database_name /sdcard

Then, replace the existing read/write privileges. This is important for the security of your app, however the privileges will be replaced on the next install.

$ run-as your.package.name
$ chmod 660 databases/database_name 
$ chmod 660 databases
$ exit # Exit the shell started with run-as

Finally, copy the database to the local disk.

$ exit # Exits shell on the mobile device (from adb shell) 
$ adb pull /sdcard/database_name

I get problems with the 2nd command: run-as. I'm getting 'com.mycompany.myappname' is unknown. And yes, I'm positive that I'm using the correct package name!
@PhuLai have you tried a different device? What device is failing?
I tried with Nexus 6P, API 25. I think this method will not work on new Android versions.
chmod 660 databases/database_name should be before chmod 660 databases
@PhuLai - I got this too and then I tried skipping the cp command and just doing a pull from outside (after changing permissions) and it worked (adb pull data/data/package.name/databases/db_name.db)
G
GeneCode

In Android Studio 3 and above You Can See a "Device File Explorer" Section in Right-Bottom Side of Android Studio.

Open it, Then You Can See The File Tree, You Can Find an Application Databases In this Path:

/data/data/{package_name}/databases/

https://i.stack.imgur.com/jCmCA.png

Rightclick the db file and Save As... (then save to your desktop).

https://i.stack.imgur.com/T0qca.png


When I double click on the DB file for my app, it shows all unreadable characters. What SQLite reader do you use to look at the DB contents?
I recommend sqlitebrowser.org free ,open source and available for all platforms.
my database.db file doesn't contains any tables.
Folder is empty. Error : run-as: Could not set capabilities: Operation not permitted. Samsung device: stackoverflow.com/questions/37413667/…
S
Scott Zhu

Finally, i found a simplest solution which do not need to open the DDMS.

Actually, the solution is based on what @Distwo mentioned, but it don't have to be that complicated.

First, remember the path of your database file in the device, it should aways the same. For example mine is:/data/data/com.XXX.module/databases/com.XXX.module.database

Second, execute this command which pulls your database file onto you PC

 adb pull /data/data/com.XXX.module/databases/com.XXX.module.database /Users/somePathOnYourPC/

What you need to do is just copy and store this command, then you can use it again and again.

Third, if you got Permission Denied or something like that, just run adb root before the previous command.


Running adb root does not work on my phone. It prints out adbd cannot run as root in production builds. After running adb root, though, the pull command just freezes and I need to stop it manually.
@Daniela try run-as your.package.name this should "log you in" as the user belonging to your app
Use above command to copy the .db file to your Desktop, install SQLiteManager browser plugin in Firefox and start browsing. 2 minute job!
that root command was for emulator, you can't just run this command and root your 'phone'.
everything is done, got the database.db. file BUT that database.db file doesn't contains any tables
D
Daniel

The easiest way is to use Android Debug Database library (7.7k stars on GitHub).

https://i.stack.imgur.com/w3f7l.png

Advantages:

Fast implementation

See all the databases and shared preferences

Directly edit, delete, create the database values

Run any SQLite query on the given database

Search in your data

Download database

Adding custom database files

No need to root device

How to use:

Add debugImplementation 'com.amitshekhar.android:debug-db:1.0.6' to build.gradle (module); Launch app; Find the debugging link in logs (in LogCat) (i.e. D/DebugDB: Open http://192.168.232.2:8080 in your browser, the link will be different) and open it in the browser; Enjoy the powerful debugging tool!

Important:

Unfortunately doesn't work with emulators

If you are using it over USB, run adb forward tcp:8080 tcp:8080

Your Android phone and laptop should be connected to the same Network (Wifi or LAN)

For more information go to the library page on GitHub.


This is the best and less painful process ! Thank you Daniel
fyi for some who may be here, I couldn't get this to work on react native android so far
Best solution by far!
A
Amir Hossein Ghasemi

Try this android studio plugin SQLScout. you can see and edit your app database realtime.

https://i.stack.imgur.com/xvQvR.png

Edit: Remember it's a paid plugin, but have 24h trial and suitable for headache time.


It's paid product, you forgot to mention.
not really, it has 24 hours trial, I planned my future as a developer for more than 24 hours.
Sadly, It is not free.
Ther trial time is only 36 hours.
N
Nabin

Simple and easy way to see database content within Android studio.

#For Android Studio 4.1 Canary 6 and higher

You can use a very simple Android Studio's feature Database Inspector. Where you can inspect, query, and modify your app’s databases using the new Database Inspector. For example, you can debug your running app by modifying values in your database and testing those changes on the device in real-time without leaving Android Studio.

To get started, deploy your app to a device running API level 26 or higher and select View > Tool Windows > Database Inspector from the menu bar.

#For Android Studio 4.0 and lesser

First, install Database Navigator plugin in Android Studio

https://i.stack.imgur.com/K30VD.png

Second, Restart Android Studio

Third, save the database into the default location like: (C:\Users\User Name\Documents\AndroidStudio\DeviceExplorer\emulator or device\data\data\package name\databases)

https://i.stack.imgur.com/I0ukJ.png

Fourth, Connect saved dbname_db file in Database Navigator

https://i.stack.imgur.com/wVAGT.png

Give same DB file path that is used in step Third

i.e (C:\Users\User Name\Documents\AndroidStudio\DeviceExplorer\emulator or device\data\data\package name\databases\package naem\dbname_db)

Finally, just test DB connection and open console and do whatever you want to do.

https://i.stack.imgur.com/QS7wM.png

If you want to refresh DB just repeat step Second and just save it or refresh.

HAPPY CODING!!!!!


This solution need a lot of efforts for your every day work. And on each change in the database you need to reload sql file - seem a bit complicated. I prefer to use some plugins which give ability to view database on the local server
Yes, you are right, till there is no realtime data update in Database Navigator, I hope it will update it's plugins soon.
Exactly, it would be a great feature
Yes, until now this one is the best way for me if we need to query data, add, edit and delete
Do I need always to do the save to refresh the database? is there an easier way like in mysql all I need is to hit the refresh button.
B
Badri Paudel

Even though this is pretty old question but I think it's still relevant today. With the latest version of android studio I found a way to see it [ I am not sure if it was available in the previous versions. ]

Here is how you can see the data in your database :

steps :

Go to View > Tool Windows > Device File Explorer Then the folder data > data and you will see applications lists. There scroll down a little bit and see the package [ your package for application ]. After finding your package, see databases folder and select file, right click it and save [ download ] As you can't see the data directly, there is a tool, DB Browser for SQLite, go website https://sqlitebrowser.org/ Open Db browser and click open database and choose the database table you downloaded and it will show you the data.

NEW EDIT

Now (the time you're reading this post), it's even easier because Android studio already comes with database inspector (just near to bottom right corner).

Click on that and you will see the database. But, make sure that minimun API level is 26, if not change it through build.gradle file as minSdkVersion 26


G
Grae

After going through all the solutions i will suggest

Use Stethos Lets see how Simple it is

Add following dependencies in build.gradle file

implement 'com.facebook.stetho:stetho:1.5.0'
implement 'com.facebook.stetho:stetho-js-rhino:1.4.2'

Then go to you mainActivity onCreate method add following line

Stetho.initializeWithDefaults(this);

this would require you to

import com.facebook.stetho.Stetho;

now while running app from android studio , Open Chrome and in address bar type chrome://inspect/

in the resources tab >web SQL check the the database and table play with it in real time easily

Update: Stethos is broken in recent versions of Chrome. If having trouble, try Edge dev tools instead edge://inspect/#devices - See: https://stackoverflow.com/a/67674265/14232521


Room is just orm, nothing changes in terms of sql it works same way
A
Anoop M Maddasseri

New Database Inspector introduced in Android 4.1 Canary 5 Preview where you can now Inspect, query, modify, and debug SQLite databases in your running app directly from the IDE - https://developer.android.com/studio/preview/features?linkId=86173020#database-inspector

Supports database live query as well - https://developer.android.com/studio/preview/features?linkId=86173020#query

https://i.stack.imgur.com/37beE.png


I have already posted this answer so it's just a duplicate answer and no need to post a link to this answer at the top for promotion.
M
MD05

To know where sqlite database stored created by you in android studio, you need to follow simple steps:

1.Run your application
2.Go to Tools--->Android---->Device Monitor
3.Find your application name in left panel
4.Then click on File Explorer tab
5.Select data folder
6.Select data folder again and find your app or module name
7.Click on your  database name
8.On right-top window you have an option to pull file from device.
9.Click it and save it on your PC
10.Use FireFox Sqlite manager to attach it to your project.

For more information this link will be useful. http://www.c-sharpcorner.com/UploadFile/e14021/know-where-database-is-stored-in-android-studio/

To view your data present in db file you need to download sqlite browser or add plugin of the same in any browser so you need to open file in browser and view your data.

Download browser from http://sqlitebrowser.org/

Here is screenshot showing browser containing register database

Thanks,


G
Gal Rom

The simplest way is to Attach your device and run Android Studio Then From Tool Bar:

View --> Tools Window --> Device File Explorer Go into data/data and find your package find the DB file you want to explore and download it I recommend on this online tool: https://sqliteonline.com/ to explore the db file

Another way is using Stetho library:

Add Stello dependency to your build.gradle: compile 'com.facebook.stetho:stetho:1.5.0' Put Following line on your onCreate() of your Application class or main Activity: Stetho.initializeWithDefaults(this); Connect your device, run the app and Enter the following site on Chrome: chrome://inspect/#devices

and that is it. you can now explore your tables.

Note: it is recommended to remove the dependency before moving to production.


P
Pavneet_Singh

With the release of Android Studio 4.1 Canary and Dev preview , you can use a new tool called

Database Inspector

https://i.stack.imgur.com/lLdnM.png

Install AS 4.1+, run the app, open database inspector, now you can view your database files on the left side of the database inspector panel then select the table to view the content.

Live Queries

Either you can run you queries using Run SQL option or if you are using Room then open database inspector and run the app then, you can run the DAO queries in your interface by clicking on the run button on left of @Query annotation.

https://i.stack.imgur.com/XpdAE.png


j
j3App

If you want to browse your databases FROM WITHIN ANDROID STUDIO, here's what I'm using:

Go to Files / Settings / Plugins and look for this:

https://i.stack.imgur.com/QXu0e.png

https://i.stack.imgur.com/ysdcM.png

https://i.stack.imgur.com/jasn8.png


So I have to copy db from emulator all the time ?
n
nocommit

This might not be the answer you're looking for, but I don't have a better way for downloading DB from phone. What I will suggest is make sure you're using this mini-DDMS. It will be super hidden though if you don't click the very small camoflage box at the very bottom left of program. (tried to hover over it otherwise you might miss it.)

Also the drop down that says no filters (top right). It literally has a ton of different ways you can monitor different process/apps by PPID, name, and a lot more. I've always used this to monitor phone, but keep in mind I'm not doing the type of dev work that needs to be 120% positive the database isn't doing something out of the ordinary.

Hope it helps

https://i.stack.imgur.com/dsiIv.png


e
elliptic1

I've put together a unix command-line automation of this process and put the code here:

https://github.com/elliptic1/Android-Sqlite3-Monitor

It's a shell script that takes the package name and database name as parameters, downloads the database file from the attached Android device, and runs the custom script against the downloaded file. Then, with a unix tool like 'watch', you can have a terminal window open with a periodically updating view of your database script output.


ᴛʜᴇᴘᴀᴛᴇʟ

This is a VERY old question and my answer is similar to some answers above but done MUCH faster. The script below is for Mac but I'm sure someone can modify it for Windows.

1) Open Script Editor on your Mac (you can just search for Script Editor in Spotlight) 2) Copy and paste the text below and modify it with your SDK path, package name, etc. (see below) 3) Save the script!!

Thats's it! Just press the play button on top to get the updated database file, which will be on your desktop.

replace the following things in the script below:

path_to_my_sdk ==>> put full path to your sdk my_package_name ==>> package name of your application myDbName.db ==>> file name of your database

set getLocalDb to "path_to_my_sdk/platform-tools/adb shell run-as my_package_name chmod 777 databases && path_to_my_sdk/platform-tools/adb shell run-as my_package_name chmod 777 databases/myDbName.db && path_to_my_sdk/platform-tools/adb shell run-as my_package_name cp databases/myDbName.db /sdcard/myDbName.db && path_to_my_sdk/platform-tools/adb pull /sdcard/myDbName.db /Users/User/Desktop/myDbName.db"
do shell script getLocalDb

Hope this helps someone.


It worked for me. Except you have to change the 'User' to Your MacBook User name in the output directory /Users/User/Desktop/myDbName.db
C
Community

I know the question is rather old but I believe this issue is still present.

Viewing databases from your browser

I created a development tool that you can integrate as a lib into your android app project. The tool opens a server socket in your app to communicate via web browser. You can browse through your whole database and download the database file directly through the browser.

https://i.stack.imgur.com/eVIHn.png

Integration can be done via jitpack.io:

project build.gradle:

//...
allprojects {
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}
//...

app build.gradle:

//...
dependencies {
    //...
    debugCompile 'com.github.sanidgmbh:debugghost:v1.1'
    //...
}
//...

Setup Application class

In order to only compile DebugGhostLib in certain build-types or product-flavours we need an abstract Application class which will be derived in the special flavours. Put the following class in your main folder (under java > your.app.package):

public class AbstractDebugGhostExampleApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        // Do your general application stuff
    }
}

Now, for your release build type (or product flavour), you add the following Application class to your release (or product-flavour) folder (also under java > your.app.package):

public class MyApp extends AbstractDebugGhostExampleApplication {
    @Override
    public void onCreate() {
        super.onCreate();
    }
}

This is the application class that will not reference DebugGhostLib.

Also tell your AndroidManifest.xml that you're using your own application class. This will be done in your main folder:

<manifest package="demo.app.android.sanid.com.debugghostexample" xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- permissions go here -->
    <application android:name=".MyApp"> <!-- register your own application class -->
        <!-- your activities go here -->
    </application>
</manifest>

Now, for your debug build type (or product flavour), you add the following Application class to your debug (or product-flavour) folder (also under java > your.app.package):

public class MyApp extends AbstractDebugGhostExampleApplication {
    private DebugGhostBridge mDebugGhostBridge;

    @Override
    public void onCreate() {
        super.onCreate();

        mDebugGhostBridge = new DebugGhostBridge(this, MyDatabaseHelper.DATABASE_NAME, MyDatabaseHelper.DATABASE_VERSION);
        mDebugGhostBridge.startDebugGhost();
    }
}

You can get the tool here.


this is a good tool specifically after Stetho stopped working in newer chrome,
v
vovahost

I had to pull the database from phone to PC. Now I use this very well made and free app which has a lot of features. It works on API 4.1+with a Rooted device.
Let me know if you find how to make it work without root.

https://i.stack.imgur.com/5Rbz5.png

https://play.google.com/store/apps/details?id=com.lastempirestudio.sqliteprime


e
eli

Open the Device File Explore Terminal at the Bottom of the Android Studio.

Open The folder named Data , then inside Data again open the Folder Data .

https://i.stack.imgur.com/ZGGQ2.png

Scroll Down the list of folders and find the folder with your.package.name. Open folder your.package.name > Database. You get your.databaseName. Right Click your.databaseName and Save as to C:/your/Computer/Directory.

Go to C:/your/Computer/Directory open your.databaseName with DB SQLite

https://i.stack.imgur.com/wcJYH.png


J
Jawad Zeb

For Android Studio 3.X

View -> Tool Windows -> Device File Explorer In The File Explorer data->data->com.(yourapplication package)->databases Right Click On The Database And Save on your local machine. To open, the file you can use SQLite Studio by just dragging the Database file on it.

Here is the link to SQLite Studio : https://sqlitestudio.pl/index.rvt?act=download


B
Berkay92

Finally, Android Studio supports this functionality with database inspector tab. You can apply view/update/query operations easily. It's not in stable channel for now but you can try out with the Android Studio 4.1 Canary 5 and higher.

You can see what the database inspector looks like here

And you can download appropriate version here


C
Community

Use android sqlite like the server side database

Folow these steps listed below:

Find the Database tool window and click it like below image

https://i.stack.imgur.com/H2o9u.png

Click the plus icon and select Android SQLite like below image

https://i.stack.imgur.com/ce9cX.jpg

Connect your android device to your computer Select the package you care and select the database like below image Before all these steps above you must esure that you have the right permission to access the file : /data/data//database/databasefile.db

After all these steps you will see the database content like below :

https://i.stack.imgur.com/ODTOQ.jpg

https://i.stack.imgur.com/waW76.jpg

Last important thing is

You must click the update icon every time where database data has been updated.

https://i.stack.imgur.com/Yy8NU.png

Hope this is work for you! Thank you !


M
Martin Zeitler

Android Studio has a Database Inspector bundled since version 4.1.

But it has one limitation:

The Database Inspector only works with the SQLite library included in the Android operating system on API level 26 and higher. It doesn't work with other SQLite libraries that you bundle with your app.


S
Saddan

I wonder why this solution was not mentioned here!

...In Android Studio 4.1 and higher...

1.Run your app on an emulator or connected device running API level 26 or higher.

2.Select View > Tool Windows > Database Inspector from the menu bar.

3.Select the running app process from the dropdown menu.

4.The databases in the currently running app appear in the Databases pane. Expand the node for the database that you want to inspect.

https://i.stack.imgur.com/ouGD3.png


I updated Android studio, they changed it to App inspector. Damn, spend almost half an hour figuring out where is Database Inspector. lol. I should also follow release notes.
m
minato

In Arctic fox Studio, its located in the bottom toolbar as "App Inspection"

https://i.stack.imgur.com/Px7To.png


A
Asyraf Arifin

I'm using windows 7, my device is a emulated android device API 23. I suppose it is the same for any real device as long as it is rooted and the API is not above 23

Go to Tools -> Android -> Android Device Monitor. Go to File Explorer. In my case, it is in data/data//app_webview/databases/file_0/1

I have to manually add .db at the end of the file named "1"


l
lawrghita

Its a combination from other answers with a plus

Install DB Browser for SQLite Get the exact location from Device File Explorer for MyBase.db something like "/data/data/com.whatever.myapp/databases/MyBase.db" Set the project window from Android to Project - so you can see the files (build.gradle, gradle.properties,...etc) In Project window right click and chose Open in Terminal In terminal you are now in the root director of your application from the hardisk so execute: adb pull /data/data/com.whatever.myapp/databases/MyBase.db Now on the Project window of you Android Studio you have a file "MyBase.db" Double click your db file from Project and you can now browse/edit your databases in DB Browser When you are ready just do Write Changes in DB Browser so databases are saved on hardisk In terminal with the command: adb push MyBase.db /data/data/com.whatever.myapp/databases/MyBase.db you just send from the Hardisk to device the edited database.