Search code examples
androidandroid-room

Location of Room Database on Samsung Galaxy


I wrote an Android Native Jetpack Compose application, which uses a Room database. I’ve searched on the web to find articles on where the database is actually located on the device. The answer seems to be `/data/data/’. I’m using IntelliJ, and with the emulator I am using, that is where the database is located.

However, on my Samsung Galaxy S20 FE, there is no entry for my application in /data/data. My wife has a Pixel, and the database is not there on her phone either.

Anyone know where the database might be?


Solution

  • Try running these commands:

    adb shell <- connects to your device

    run-as <app id> <- if it's a debug build, this allows get into your app's space. application id == package name

    ls <- shows app files, incl. databases