USB MTP和数据库

1 Windows netmon
1)下载安装netmon工具。
2)下载WDK辅助下载工具,运行该工具,该工具会在线下载安装真正的WDK。WDK包含WPD解析器,由于我们只需要WPD解析器,因此只需要安装WDK而不需要安装Visual Studio。
3)Install the WPD parsers on your development machine by starting an instance of Powershell.exe with Administrator permissions and running the following sequence of commands.
a. PowerShell -ExecutionPolicy RemoteSigned
b. cd “C:\Program Files (x86)\Windows Kits\10\Tools\10.0.22621.0\x86\Network Monitor Parsers\usb”
c. ..\NplAutoProfile.ps1
d. cd ..\wpd
e. ..\NplAutoProfile.ps1
4)Configure the NetMon.exe options by using the Tools/Options dialog:
a. In the General tab, select the Use fixed width font in Frame Summary box.
b. In the Color Rules tab, select Open and then Program Files (x86)\Windows Kits\10\Tools\10.0.22621.0\x86\Network Monitor Parsers\wpd\wpd.nmcr. Select Open, followed by OK.
5)创建wpd_trace.cmd文件并运行。
echo off
@REM Start Logging

logman start  -ets WPD -p Microsoft-Windows-WPD-API            -bs 100 -nb 128 640 -o wpd_trace.etl
logman update -ets WPD -p Microsoft-Windows-WPD-MTPClassDriver -bs 100 -nb 128 640
logman update -ets WPD -p Microsoft-Windows-WPD-MTPUS          -bs 100 -nb 128 640
logman update -ets WPD -p Microsoft-Windows-WPD-MTPIP          -bs 100 -nb 128 640
logman update -ets WPD -p Microsoft-Windows-WPD-MTPBT          -bs 100 -nb 128 640
logman update -ets WPD -p Microsoft-Windows-USB-USBPORT        -bs 100 -nb 128 640
logman update -ets WPD -p Microsoft-Windows-USB-USBHUB         -bs 100 -nb 128 640
logman update -ets WPD -p Microsoft-Windows-Kernel-IoTrace 0 2
echo.
echo Please run your scenario now and
pause

@REM Stop logging
logman stop -ets WPD
6)打开Netmon, 选择File/Open/Capture菜单并且打开上一步创建的wpd_trace.etl。

2 sqlite3
2.1 General Commands
cd /data/data/com.android.providers.settings
cd databases
sqlite3 settings.db
.help
.tables
.mode column;
.header on;
select * from system;

.exit

http://www.sqlite.org/cli.html

2.2 settings专用命令
settings list system
settings put system screen_brightness 50

3 MediaScannerService
3.1 CPU占用率过高
lsof | grep media_rw

3.2 停止android.process.media
命令:pm enable/disable package/package.class

pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

3.3 APK文件读写权限查询
查看进程拥有的权限
cat /proc/$PID/status
Groups表示进程所在的组
adb shell
# id media_rw
# id sdcard_rw

4 WinUSB
MSFT100: MicroSoFT Version 1.00
OSVC: OS Vendor Code
HKLM\SYSTEM\CurrentControlSet\Control\usbflags\vvvvpppprrrrr
vvvv: Vendor ID
pppp: Product ID
rrrr: bcdUSB

5 Abbreviations
wpdmon:Windows Portable Devices Monitor

你可能感兴趣的:(USB,MTP)