当前位置: 首页 > 工具软件 > fb-adb > 使用案例 >

Android debug bridge command line-adb shell tips -logcat filter /am/pm/dumpsys

锺离鸿
2023-12-01

## by grep, get rid of RMAPP

adb  logcat |grep  --invert-match    RMAPP

##  print tag of "ORE-CORE" only , others will be silent. 

adb   logcat   ORE-CORE:I *:S

##  print tag of "ORE-CORE" only from radio buffer(default is main/system), others will be silent. 

adb   logcat   -b radio ORE-CORE:I *:S

##  print tag of "ORE-CORE"  from all buffers( ), others will be silent.  

 adb logcat -b all  ORE-CORE:V  *:S
--------- beginning of kernel
--------- beginning of events
--------- beginning of main
--------- beginning of system
--------- beginning of radio
10-22 15:30:50.063  1466  1745 D ORE-CORE: OS_MMS::OSTranSendAsyncNoReply: Task 401 sending local AsyncNoReply msg 296 to task 401
...............

 

#Silent all by default except  qdhwcomposer/qdutils/SurfaceFlinger/PowerManagerService/DisplayPowerController 

adb  logcat qdhwcomposer:V   qdutils:V    SurfaceFlinger:V    PowerManagerService:V   DisplayPowerController:V    *:S  

#grep all logcat without RMAPP

adb  logcat |grep  --invert-match    RMAPP

### Filter example in Android Studio/Eclipers Log filter 

^(?!.*(TAG1|TAG2)).*$

 

       ^(?!.*(AudioFlinger|SurfaceView)).*$

       ^(?!.*(SurfaceView)).*$

##Filter Rockchip player 

^(?!.*(RockFFPlayer|FFMpeg|vpu|MX|Video|RK|Audio|Rockchip )).*$

 

## screenshot photo 

adb shell /system/bin/screencap -p /sdcard/screenshot.png 
adb pull /sdcard/screenshot.png d:/screenshot.png 

#### screen record in MP4 format 

adb shell  /system/bin/screenrecord --bit-rate 20000000   --time-limit 30   /sdcard/X2O-RK3288-Android5.1.mp4



 


### logcat filter 
logcat DisplaySettings:V   DisplaySettings:V   SystemUIApplication:V  SystemBars:V  PhoneStatusBar:V  *:E


logcat DisplaySettings:V   DisplaySettings:V   SystemUIApplication:V  SystemBars:V  PhoneStatusBar:V  *:E |grep -v  audio


###  Broadcast 
hide/display systembar
am broadcast -i "com.android.action.display_systembar"


am broadcast -i "com.android.action.hide_systembar"









 
### start activity 
am start  com.android.settings/.Settings
am start  com.android.settings/.Settings
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.android.settings/.Settings }
## logcat 
05-24 03:40:29.834  1102  2304 I ActivityManager: START u0 {act=intent.activate.main flg=0x14000000 cmp=com.x2omedia.adsp/.MainActivity} from uid 10062 on display 0
130|root@sabresd_6dq:/sdcard/X2O # pm list  packages   |grep x2                
package:com.x2omedia.adsp
root@sabresd_6dq:/sdcard/X2O #   a
130|root@sabresd_6dq:/sdcard/X2O # am start -n com.x2omedia.adsp/.MainActivity 
Starting: Intent { cmp=com.x2omedia.adsp/.MainActivity }
root@sabresd_6dq:/sdcard/X2O # ps  |grep x2o
u0_a56    2424  232   1137408 73704 futex_wait b6c895f4 S com.x2omedia.adsp

 

root@sabresd_6dq:/sdcard/X2O # 

 

 

 

######### pm 


gtelwifiue:/ $ pm list package
pm list package
package:com.samsung.android.provider.filterprovider
package:com.monotype.android.font.rosemary
package:com.samsung.oh
package:com.sec.android.app.DataCreate
package:com.skype.raider
...........






1|gtelwifiue:/ $ pm list package   -f
pm list package   -f
package:/system/app/FilterProvider/FilterProvider.apk=com.samsung.android.provider.filterprovider
package:/system/app/RoseEUKor/RoseEUKor.apk=com.monotype.android.font.rosemary
package:/system/app/SAMSUNG_PLUS/SAMSUNG_PLUS.apk=com.samsung.oh
package:/system/priv-app/AutomationTest_FB/AutomationTest_FB.apk=com.sec.android.app.DataCreate
package:/system/app/MSSkype_stub/MSSkype_stub.apk=com.skype.raider
package:/system/priv-app/CtsShimPrivPrebuilt/CtsShimPrivPrebuilt.apk=com.android.cts.priv.ctsshim






gtelwifiue:/ $ dumpsys   package       com.google.android.webview    |grep version
package       com.google.android.webview    |grep version                     <
    versionCode=311211600 minSdk=21 targetSdk=26
    versionName=60.0.3112.116
gtelwifiue:/ $




## logcat 
05-24 03:40:29.834  1102  2304 I ActivityManager: START u0 {act=intent.activate.main flg=0x14000000 cmp=com.x2omedia.adsp/.MainActivity} from uid 10062 on display 0






130|root@sabresd_6dq:/sdcard/X2O # pm list  packages   |grep x2                
package:com.x2omedia.adsp
root@sabresd_6dq:/sdcard/X2O #   a
130|root@sabresd_6dq:/sdcard/X2O # am start -n com.x2omedia.adsp/.MainActivity 
Starting: Intent { cmp=com.x2omedia.adsp/.MainActivity }
root@sabresd_6dq:/sdcard/X2O # ps  |grep x2o
u0_a56    2424  232   1137408 73704 futex_wait b6c895f4 S com.x2omedia.adsp
root@sabresd_6dq:/sdcard/X2O # 
 

 类似资料: