0

I'm debugging my android app in Android Studio using a real android device and. I see that the Sqlite db path is

/data/data/com.my_app/databases/data1.db 

I want to remove it. By that path doesn't exist when try to find it by a file manager. And, of course, this isn't working:

adb -e shell rm /data/data/com.my_app/databases/data1.db
adb server is out of date.  killing...
* daemon started successfully *
error: device not found

So how can I remove it and why isn't it visible in my smartphone?

1
  • 2
    It's not visible on your smartphone because you don't have root access, by default. To remove it, simply uninstall your app. Commented Oct 28, 2015 at 16:32

2 Answers 2

4

why isn't it visible in my smartphone?

Because it is on internal storage, which you do not have access to, except on emulators and rooted devices.

And, of course, this isn't working:

That is some separate problem with adb running on your machine.

So how can I remove it

If you want to completely clear your app's data (databases, SharedPreferences, and other files) on internal storage, use the Settings (e.g., Settings > Apps > (your app) > Clear Data on Android 4.x/5.x).

If you specifically want to get rid of this file on an emulator, the command you tried should be fine. I suggest restarting the emulator.

If you specifically want to get rid of this file on production hardware, you will need to use run-as:

adb shell run-as com.my_app rm /data/data/com.my_app/databases/data1.db
Sign up to request clarification or add additional context in comments.

Comments

1

You can't reach that directory if your device isn't root . For change or modify system files you must have root access .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.