LoginSignup
1
3

More than 5 years have passed since last update.

Androidのローカルストレージを覗き見る

Posted at
  • アプリがデータを保管する時に、正しく保管できたか・正しいデータを保管できたか、を確認する機会があったのでメモる

前提 

  • root昇格させた端末、もしくはエミュレーター(root)でのみ確認可能

手順

対象アプリのパッケージ名を取得

hoge.sh
% adb -e shell ls -la /data/data/ | grep -i hogehoge 

パッケージ配下のdatabases内のdb名を確認

hoge.sh
% adb -e shell ls -laR /data/data/com.hoge.hoge/databases

抽出

hoge.sh
% adb pull /data/data/com.hoge.hoge/databases/hoge.db

データの内容を見る

  • AndroidのdbはSQLiteなのでsqlite3で読み込む
hoge.sh
% sqlite3 hoge.db 
SQLite version 3.8.5 2014-08-15 22:37:57
Enter ".help" for usage hints.
sqlite> .tables
hoge
sqlite> select * from hoge;             

以上

その他

端末に落としたAndroidアプリのAPKファイルを抽出する

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3