1.「ADB」利用

個人的な調査

カテゴリー: SQLite  閲覧数:681 配信日:2013-07-10 12:52


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)


週間人気ページランキング / 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 更新
指定期間人気ページランキング / 2020-5-27 → 2024-9-20
順位 ページタイトル抜粋 アクセス数
1 インポートされた ★★ は見つかりません | エラー 22064
2 public 型 ★★ はそれ独自のファイル内に定義されなければなりません | エラー 9612
3 ○○は解決できないか、フィールドではありません | エラー(エラー) 6607
4 いくつかのプロジェクトは、ワークスペース・ディレクトリーにすでに存在するため、インポートできません | エラー 6353
5 この行に複数マーカーがあります | エラー(エラー) 6259
6 ★★ を型に解決できません | エラー(エラー) 6095
7 プラグイン "org.eclipse.ui.workbench" からのコードの起動で問題が発生しました | エラー(エラー) 4625
8 「Android Studio 3.0.1」で、デザインプレビュー画面が表示されない。「waiting build for finish」が終わらない | Android Studio(IDE) 3838
9 Android FAQ 2968
10 Eclipse で「パッケージ名」変更 | Eclipse(IDE) 2726
11 Androidエミュレータで、PCキーボード入力を有効にしたい | エミュレータ(環境構築) 2514
12 キーバインドの競合が発生しました。 通常のアクセラレーター操作を妨げる可能性があります。 | エラー(エラー) 2073
13 Eclipse で「プロジェクト名」「パッケージ名」を変更する方法 | Eclipse(IDE) 2072
14 Eclipseが起動しない … ユーザ操作は待機中です | Eclipse(IDE) 2031
15 Android Studio で、ソースコードが改行できない | Android Studio(IDE) 1816
16 このメソッドは型 ○○ の結果を戻す必要があります | エラー(エラー) 1740
17 内部エラーの表示中に内部エラーが発生しました | エラー 1681
18 インポートされた java.io は見つかりません | エラー(エラー) 1501
19 エラーが発生しました。ログ・ファイル ★★.log.を参照してください | エラー(エラー) 1296
20 インポートされたRは見つかりません | エラー(エラー) 1045
2024/9/21 1:01 更新