Skip to content

How to get cache in Android Browser on Emulator


How to get cache in Android Browser on Emulator

Sep 26 2009

On target, the behavior might be different.
For example, some target has no support of sqlite3.

1.Run emulator
Suppose that current directory is android source root directory.
Suppose that build is already done.

$. build/
$lunch 1

2.Run WebKit cache db
$adb shell

Now adb shell is executed.
#cd /data/data/

Check db name.

#sqlite3 webviewCache.db
SQLite version 3.5.9

3.Fetch cache data

android_metadata cache
sqlite>select * from cache;
2||4ab55f19|Mon, 06 Apr 2009 12:37:23 GMT||1285556709831|image/gif||200||4367

Suppose that we’re looking for html fine in 1st URL

schema of the cache table is as following.
sqlite> .schema cache
CREATE TABLE cache (_id INTEGER PRIMARY KEY, url TEXT, filepath TEXT, lastmodify TEXT, etag TEXT, expires INTEGER, mimetype TEXT, encoding TEXT,httpstatus INTEGER, location TEXT, contentlength INTEGER, UNIQUE (url) ON CONFLICT REPLACE);
CREATE INDEX cacheUrlIndex ON cache (url);

4.Find the cached file
Terminate query mode.
sqlite> .quit

Since 2nd column is filepath, check that file exists.
#cd ../cache/webviewCache/


Termiate adb shell

5.Copy the file from Emulator to Host

$adb pull /data/data/ .
94 KB/s (46635 bytes in 0.484s)

$mv 0ded30f8 test.html

Now you have the HTML file.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: