Omar BISTAMI
Omar BISTAMI

Reputation: 850

Android adb shell delete SQLite database

I need to delete an SQLite database and in order to do so , i need to access adb shell.

i'm on windows 7 and i have my sdk installed on:

C:\Users\Omar\AppData\Local\Android

i have opened the cmd and typed adb shell but with no success here is my output :

C:\Users\Omar>adb shell
'adb' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

c:\>adb shell
'adb' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

"unknown command"

Do i need to do something before calling the adb from my windows cmd ? like creating a classpath ?

Thanks a lot in advance ^^

Upvotes: 3

Views: 4200

Answers (3)

Atul
Atul

Reputation: 4340

This can be done in a single line command like this:

adb shell "run-as your.package.name rm /data/data/your.package.name/databases/YourDBFileName.db"

Upvotes: 3

Omar BISTAMI
Omar BISTAMI

Reputation: 850

Thanks a lot it worked with :

C:\Users\Omar\AppData\Local\Android\platform-tools\adb shell

After that i did

cd /data/data/(my application package, com...etc)/Databases

and

rm (mydatabase)

Upvotes: 2

CommonsWare
CommonsWare

Reputation: 1007494

Either add C:\Users\Omar\AppData\Local\Android\platform-tools to your PATH environment variable, or fully-qualify the path to the command you want to run:

C:\Users\Omar\AppData\Local\Android\platform-tools\adb shell

Upvotes: 2

Related Questions