「SQLite Database 」へ保存したデータを確認したい

SQLite

概要

 状態:解決済  閲覧数:3,714  投稿日:2013-07-10  更新日:2013-07-10
・エミュレータ利用時に、「SQLite Database 」へ保存したデータを確認したい


2方法


・方法は大きく2種類に分かれる
1.「ADB」利用
2.「DDMS」利用

1.「ADB」利用

 閲覧数:680 投稿日:2013-07-10 更新日:2013-07-11

adb shell


コマンドプロンプト経由で、エミュレータデータへアクセス
C:\Users\Administrator>adb shell
# cd data/data/com.fc2.blog98.andromaker.housekeepingbook/databases
cd data/data/com.fc2.blog98.andromaker.housekeepingbook/databases
# ls
ls
output.txt
androidoutput.txt
c:dump.txt
C:output.txt
HousekeepingBook.db

# exit
exit

※exitする前に、コマンドで内容確認可能


adb


利用可能adbコマンド一覧を表示

C:\Users\Administrator>adb
Android Debug Bridge version 1.0.31

-d                            - directs command to the only connected USB device
                                returns an error if more than one USB device is present.
-e                            - directs command to the only running emulator.
                                returns an error if more than one emulator is running.
-s <specific device>          - directs command to the device or emulator with the given
                                serial number or qualifier. Overrides ANDROID_SERIAL
                                environment variable.
-p <product name or path>     - simple product name like 'sooner', or
                                a relative/absolute path to a product
                                out directory like 'out/target/product/sooner'.
                                If -p is not specified, the ANDROID_PRODUCT_OUT
                                environment variable is used, which must
                                be an absolute path.
devices [-l]                  - list all connected devices
                                ('-l' will also list device qualifiers)
connect <host>[:<port>]       - connect to a device via TCP/IP
                                Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
                                Port 5555 is used by default if no port number is specified.
                                Using this command with no additional arguments
                                will disconnect from all connected TCP/IP devices.

device commands:
 adb push <local> <remote>    - copy file/dir to device
 adb pull <remote> [<local>]  - copy file/dir from device
 adb sync [ <directory> ]     - copy host->device only if changed
                                (-l means list but don't copy)
                                (see 'adb help all')
 adb shell                    - run remote shell interactively
 adb shell <command>          - run remote shell command
 adb emu <command>            - run emulator console command
 adb logcat [ <filter-spec> ] - View device log
 adb forward <local> <remote> - forward socket connections
                                forward specs are one of:
                                  tcp:<port>
                                  localabstract:<unix domain socket name>
                                  localreserved:<unix domain socket name>
                                  localfilesystem:<unix domain socket name>
                                  dev:<character device name>
                                  jdwp:<process pid> (remote only)
 adb jdwp                     - list PIDs of processes hosting a JDWP transport
 adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
                              - push this package file to the device and install it
                                ('-l' means forward-lock the app)
                                ('-r' means reinstall the app, keeping its data)
                                ('-s' means install on SD card instead of internal storage)
                                ('--algo', '--key', and '--iv' mean the file is encrypted already)
 adb uninstall [-k] <package> - remove this app package from the device
                                ('-k' means keep the data and cache directories)
 adb bugreport                - return all information from the device
                                that should be included in a bug report.

 adb backup [-f <file>] [-apk|-noapk] [-shared|-noshared] [-all] [-system|-nosystem] [<packages...>]
                              - write an archive of the device's data to <file>.
                                If no -f option is supplied then the data is written
                                to "backup.ab" in the current directory.
                                (-apk|-noapk enable/disable backup of the .apks themselves
                                   in the archive; the default is noapk.)
                                (-shared|-noshared enable/disable backup of the device's
                                   shared storage / SD card contents; the default is noshared.)
                                (-all means to back up all installed applications)
                                (-system|-nosystem toggles whether -all automatically includes
                                   system applications; the default is to include system apps)
                                (<packages...> is the list of applications to be backed up.  If
                                   the -all or -shared flags are passed, then the package
                                   list is optional.  Applications explicitly given on the
                                   command line will be included even if -nosystem would
                                   ordinarily cause them to be omitted.)

 adb restore <file>           - restore device contents from the <file> backup archive

 adb help                     - show this help message
 adb version                  - show version num

scripting:
 adb wait-for-device          - block until device is online
 adb start-server             - ensure that there is a server running
 adb kill-server              - kill the server if it is running
 adb get-state                - prints: offline | bootloader | device
 adb get-serialno             - prints: <serial-number>
 adb get-devpath              - prints: <device-path>
 adb status-window            - continuously print device status for a specified device
 adb remount                  - remounts the /system partition on the device read-write
 adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
 adb reboot-bootloader        - reboots the device into the bootloader
 adb root                     - restarts the adbd daemon with root permissions
 adb usb                      - restarts the adbd daemon listening on USB
 adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
networking:
 adb ppp <tty> [parameters]   - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ <directory> ]
 <localdir> can be interpreted in several ways:

 - If <directory> is not specified, both /system and /data partitions will be updated.

 - If it is "system" or "data", only the corresponding partition
   is updated.

environmental variables:
 ADB_TRACE                    - Print debug information. A comma separated list of the following values
                                1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
 ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.
 ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.



adb pull


コマンドプロンプトより、DUMPデータをPC指定ディレクトリへ保存
adb pull Android端末上のローカルファイル(フルパス) ファイルをコピーするPC環境のパス
C:\Users\Administrator>adb pull data/data/com.fc2.blog98.andromaker.housekeepingbook/databases/HousekeepingBook.db D:\Android\wor
k2
33 KB/s (12288 bytes in 0.357s)


2.「DDMS」利用

 閲覧数:508 投稿日:2013-07-11 更新日:2013-07-11

概要


Eclipse経由で、SQLiteデータベースを保存
・ウィンドウ→パースペクティブを開く→DDMS→ファイルエクスプローラタブを表示
・data/data/パッケージ名(例:com.fc2.blog98.andromaker.house)/databases/★★.db
・「フロッピーアイコンクリック」してデータベース保存

SQLite GUI 管理ツール

 閲覧数:622 投稿日:2013-07-11 更新日:2013-07-11

概要


SQLite GUI 管理ツール」で、先ほど保存したDUMPデータを読み込む
※1.「ADB」、2.「DDMS」、何れで出力したデータでも、内容確認可能


PupSQLite


v1.16.1.3(13/06/30)
・今回は、最終更新が最近のPupSQLiteを利用
・特に悩むことなく、直感的に操作可能


「SQLite」利用しているのに、データベースが見つからない



類似度ページランキング
順位 ページタイトル抜粋
1 「SQLite Database 」へ保存したデータを確認したい 78
2 「SQLite」利用しているのに、データベースが見つからない 42
3 「Live Template」で「fbc」が表示されない 33
4 データベースを利用するためには、 SQLiteOpenHelperクラスが必要なの? 32
5 エミュレータ利用時、「adb shell」ルートパスが、Windows全体ではどの位置にあるか知りたい 29
6 please select Android SDK 28
7 エミュレータ中身を「ファイル・エクスプローラ」で確認したいのに、何も表示されない 28
8 Eclipse で「パッケージ名」変更 27
9 SDK Manager: failed to install 26
10 Android Studio の Designプレビュー で、ウィジェットをドラッグ配置できない 25
11 エディターを開くことができません: 予期しない例外が起こりました。 25
12 Eclipse で「プロジェクト名」「パッケージ名」を変更する方法 24
13 エミュレーター画面表示を大きくしたい 24
14 Android Studio の Designプレビュー で、ウィジェットを中央に配置 24
15 values-ja/strings.xmlに記載した内容が反映されない 24
16 Eclipseが起動しない … ユーザ操作は待機中です 24
17 Android Studio で、「パッケージ名」変更 24
18 Eclipseでログ出力を確認する方法 24
19 「android compile with 」プルダウン内容が表示されないため、プロジェクト作成完了ボタンをクリックできない 23
20 「Android Studio 3.1.2」で「Propertiesペイン」が表示されない 23
2024/9/21 15:32 更新
週間人気ページランキング / 9-14 → 9-20
順位 ページタイトル抜粋 アクセス数
1 インポートされた ★★ は見つかりません | エラー 57
2 ○○は解決できないか、フィールドではありません | エラー(エラー) 26
3 いくつかのプロジェクトは、ワークスペース・ディレクトリーにすでに存在するため、インポートできません | エラー 22
3 Androidエミュレータで、PCキーボード入力を有効にしたい | エミュレータ(環境構築) 22
4 public 型 ★★ はそれ独自のファイル内に定義されなければなりません | エラー 21
5 この行に複数マーカーがあります | エラー(エラー) 20
6 「Android Studio 3.0.1」で、デザインプレビュー画面が表示されない。「waiting build for finish」が終わらない | Android Studio(IDE) 13
7 プラグイン "org.eclipse.ui.workbench" からのコードの起動で問題が発生しました | エラー(エラー) 9
8 Eclipse で「プロジェクト名」「パッケージ名」を変更する方法 | Eclipse(IDE) 7
8 Android Studio で、ソースコードが改行できない | Android Studio(IDE) 7
9 Eclipseが起動しない … ユーザ操作は待機中です | Eclipse(IDE) 6
9 内部エラーの表示中に内部エラーが発生しました | エラー 6
10 既存プロジェクトがインポート出来ない | プロジェクト(環境構築) 5
10 インポートされた java.io は見つかりません | エラー(エラー) 5
11 Android FAQ 4
11 ファイルのパスをコピーする方法と結果は、右クリックする場所で異なる | Android Studio(IDE) 4
11 ★★ を型に解決できません | エラー(エラー) 4
11 java.lang.NullPointerException | エラー(エラー) 4
11 キーバインドの競合が発生しました。 通常のアクセラレーター操作を妨げる可能性があります。 | エラー(エラー) 4
12 エラーが発生しました。ログ・ファイル ★★.log.を参照してください | エラー(エラー) 3
2024/9/21 1:01 更新