adb captures the Android app (ip connection device)

adb captures the Android app (ip connection device)

1. First, open the developer mode of the Android device and prompt to allow adb debugging

Second, your laptop should be on the same network segment as the Android device (just connect to a WiFi)

3. Connect the Android device according to the ip on the notebook: adb connect 192.168.1.11

 Enter adb devices to view the device just connected

 

Fourth, find the package name

 Enter adb shell to enter the shell of the device just connected, and then enter pm list packages to check which packages are installed on the Android device

You can also search for the package name based on keywords: pm list packages | grep tencent

 Five, capture the data request of the app package

1. Grab the socket request:

We first use adb shell "ps|package name" such as: adb shell "ps|grep com.dangdang.buy2", the method of filtering package name: adb shell dumpsys activity | find "mFocusedActivity"

  This command can filter out the process number PID of the application, as shown in the figure:

 Then execute adb shell to enter the system, execute logcat | grep PID, the pid here is 4763

 The final result: (this is the capture of the socket)

 If there are garbled characters in Chinese, you can execute the "chcp 65001" command in cmd to change the encoding to UTF-8 to prevent the problem of garbled characters in Chinese.

If chcp is not an internal or external command, you need to add it to the path: C:\WINDOWS\system32

 2. Grab http or https requests:

  Step 1, get the package name

  Step 2, filter process

  Step 3, adb shell logcat |grep 4763 | grep https > d:\test\tv.txt (filter https and write the log directly to the specified document)

  Filtering http requests is the same adb shell logcat |grep 4763 | grep http > d:\test\tv.txt

  You can also add time to grab: adb shell "logcat -v threadtime |grep 5303 | grep https" > d:\test\tv.txt


The following are the better learning tutorial resources I have collected. Although they are not very valuable, if you just need them, you can leave a message in the comment area [777] and just take them away

Friends who want to get information, please like + comment + favorite , triple!

After three times in a row , I will send you private messages one by one in the comment area~

Guess you like

Origin blog.csdn.net/m0_70618214/article/details/132279577