Android will save the Sqlite files in a directory called "Databases" inside the app package on the operating system.
To access this directory in an easy way, open Android Studio and find the option "Device File Explorer". In my Android Studio version 3.3.1 it is being displayed in the lower right corner of the IDE, if it does not appear in yours you can search for the option directly in the bar at the top that will find it.
After accessing the Device File Explorer, the list of connected devices will be shown inside a combobox (you can switch between the devices by selecting the desired one). Below is listed a lot of files and directories that are the files that Android has inside it.
Find in this list the directory data
and open it. Another list will be shown with other directories, find again one with the name data
(that’s right, are 2 data
, one inside the other). When entering the second directory data
search for your app package (to find its name open the Android Manifest
from the app and right at the beginning of it find the package
, the name there is what you need to find). The last step is to open the package directory of your app and access the folder databases
, inside it is where is the bank file of your application.
Detail: The database file is created only when the app tries to access it. It is not enough to just open the application, the bank will only be created when it is actually requested access to it. If no call is made to the bank when the app is opened, it will not be created, at the time of any query or insertion or any action is that this happens.
Using the emulator it is even possible to extract this database easily using an "adb" CLI command. (If you have 2 or more connected devices you need to specify which one the command will be applied to. As soon as you keep only 1 emulator open and have no real device connected to the PC at this time so you can understand how the command works, later you can search the methods of directing the command even with more connected devices)
Syntax:
adb pull /data/data/<package da aplicacao>/databases/<nome do banco> <local de destino>
Example:
adb pull /data/data/com.exemple.app/databases/banco.db %USERPROFILE%\Desktop\
I used the "monitor.exe" and it can not open the folder "date" that is inside the com.'meuapp', I click to open but will not...
– Igor Boldt
I know no other method
– GabrielLocalhost