Sunday, March 4, 2012

Access sqlite within Emulator from your sell command



$ adb -s emulator-5554 shell
## sqlite3 /data/data/[Your Package Name Here]/databases/[Your Databasefile name here]
sqlite3 /data/data/ [Your Package Name Here] /databases/[Your Databasefile name here]
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .dump
.dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE android_metadata (locale TEXT);
INSERT INTO "android_metadata" VALUES('en_US');
CREATE TABLE  [Your Databasefile name here] (_id integer primary key autoincrement,contactI
D integer, ImagePath TEXT);
INSERT INTO " [Your Databasefile name here] " VALUES(1,3,'/mnt/sdcard/rebeca.jpg');
DELETE FROM sqlite_sequence;
INSERT INTO "sqlite_sequence" VALUES(' [Your Databasefile name here] ',1);
COMMIT;
sqlite>



No comments:

Post a Comment