当前位置: 首页 > news >正文

安卓驱动的部分命令总结

安卓驱动的部分命令总结

第一部分

$ git config core.filemode false #去掉权限检查的情况  git status ./的时候#配置menuconfig的时候应该操作;安卓7或者8以上需要这样配指defconfig
$ make ARCH=arm64 menuconfig   //安卓11保存.config文件
$ make ARCH=arm64 savedefconfig
$ cp defconfig arch/arm64/configs/rockchip_defconfig#单独编译kernel ,一般在IMAGE/  build_cmd_info.txt
$ make ARCH=arm64 rockchip_defconfig   android-11.config      #指定编译的宏配置 多个deconfig是叠加的关系
$ make ARCH=arm64 BOOT_ IMG=. ./ rockdev/ Image-rk3326_ r/boot. img   main_dts.img -j24
#make ARCH=arm64 BOOT_ IMG=. ./ rockdev/ Image-rk3566_ _r/boot. img rk3566-rk817tablet fimg 1-j24#关掉动态打印信息
$ echo 0 > /proc/sys/kernel/printk     
$ cat d/gpio                                 #查看已申请的gpio状态
$ cat /proc/sys/kernel/printk                #查看动态printk的打印信息等级
$ cat d/pinctrl/pinctrl/pins                    #查看pin组合对应的gpio号
$ cat /sys/kernel/debug/pinctrl/pinctrl-rockchip-pinctrl/pinmux-pins #脚功能复用查看
$ cat /sys/kernel/debug/gpio #查看gpio状态
$ cat proc/asound/cards                    #查看声卡的驱动命令然后修改队形声卡型号的驱动文件#遥控IR
$ echo 1 > sys/module/rk_pwm_remotectl/parameters/dbg_level             #打开预留调试开关
$ echo 1 > sys/module/rockchip_pwm_remotectl/parameters/code_print  
console:/ $ [ 1419.306926] USERCODE=0xff00
[ 1419.334014] RMC_GETDATA=bd#git的提交回退
$ git reset --soft HEAD^   #提交最近的一次提交
#然后
$ git reset  ./   #撤下暂存区的提交#查看动态log信息
$ cat proc/kmsg$ stat local_diff.patch #查看文件时间#camera
$ ls /dev/video*                   #查看是否存在camera外设,设备节点 
$ adb shell dumpsys media.camera   #dump对应的camera信息
$ dumpsys media.camera |grep picture-size//Camera preview 相关信息picture-size: 1920x1080picture-size-values: 640x480,1920x1080,1600x1080,1280x720,640x360,352x288,176x144,160x120,848x480,320x240$ adb shell dumpsys media.camera
...
Camera module HAL API version: 0x3
Camera module API version: 0x1
Camera module name: RK29_ICS_CameraHal_Module
Camera module author: RockChip
Number of camera devices: 1  //Camera个数 双目:2  单个:1  识别不到:0Vendor tags left unimplemented.
Camera 0 static information:Facing: BACKOrientation: 0            //Camera预览方向:对应设置里面的“摄像头方向”,这里相当于读取Device version: 0x100Device is open. Client instance dump:
Client[0] (0xb86d2b18) PID: 1360
Latest set parameters:
CameraParameters::dump: mMap.size = 50antibanding: offantibanding-values: off,50hz,60hz,autoexposure-compensation: 0exposure-compensation-step: 1focal-length: 35focus-distances: 0.3,50,Infinityfocus-mode: fixedfocus-mode-values: fixedhorizontal-view-angle: 10jpeg-quality: 90jpeg-thumbnail-height: 128jpeg-thumbnail-quality: 50jpeg-thumbnail-size-values: 0x0,160x128jpeg-thumbnail-width: 160max-exposure-compensation: 3max-num-detected-faces-hw: 0max-num-detected-faces-sw: 0max-num-focus-areas: 0max-num-metering-areas: 0max-zoom: 40min-exposure-compensation: -3picture-format: jpeg             //Camera preview 相关信息          picture-format-values: jpeg                   picture-size: 1920x1080      //预览分辨率picture-size-values: 640x480,1920x1080,1600x1080,1280x720,640x360,352x288,176x144,160x120,848x480,320x240preferred-preview-size-for-video: 1280x720preview-format: yuv420sppreview-format-values: yuv420sp,yuv420ppreview-fps-range: 10000,15000preview-fps-range-values: (10000,15000)preview-frame-rate: 15preview-frame-rate-values: 15,10preview-size: 1920x1080preview-size-values: 640x480,1920x1080,1600x1080,1280x720,640x360,352x288,176x144,160x120,848x480,320x240recording-hint: falserk-continous-pic-num: 1rk-previwe-h-force: 0rk-previwe-w-force: 0rotation: 0vertical-view-angle: 10video-frame-format: yuv420spvideo-size: 1280x720video-size-values: 176x144,320x240,352x288,640x480,1280x720,1920x1080video-snapshot-supported: truevideo-stabilization-supported: falsewhitebalance: autowhitebalance-values: auto,incandescent,fluorescent,daylight,cloudy-daylightzoom: 0zoom-ratios: 100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,zoom-supported: trueCamera traces (0):No camera traces collected.

第二部分

#模拟按键adc按键
$ cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw
$ cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw    # adc_in0内获取的通道
$ cat sys/kernel/debug/pinctrl/pinctrl-rockchip-pinctrl/pinmux-pins  #查看GPIO的状态#查看CEC是否连接
$ cat  /sys/kernel/debug/cec/cec0/status
configured: 1
configuring: 0
phys_addr: 2.0.0.0
number of LAs: 1
LA mask: 0x0010
has CEC follower (in passthrough mode)
pending transmits: 0#wifi模块
$ cmd wifi set-wifi-enabled enabled   #打开wifi开关
$ cmd wifi connect-network HUAWEI666 wpa2 adw123456      #连接热点
$ cmd wifi connect-network HUAWEI-AF16O5  wpa2 adw888888 #连接热点
$ cmd wifi start-softap HUAWEI-AF16O5 wpa2  adw888888    #关闭wifi连接的热点
$ cmd wifi status              #查看wifi的开光状态
$ cmd wifi start-scan          #wifi进行扫描
$ cmd wifi list-scan-results   #wifi扫描后的结果#wpa_cli工具进行扫描 底层的命令
$ wpa_cli -i wlan0 scan         #wifi扫描   
$ wpa_cli -i wlan0 scan_result  #wifi扫描结果#对应的wifi的ko存在位置
console:/ # cd vendor/lib/modules/                                             
console:/vendor/lib/modules # ls
8723cs.ko  8822bs.ko  bcmdhd.ko      modules.alias  modules.load
8821cs.ko  8822cu.ko  mali_kbase.ko  modules.dep    modules.softdep
console:/vendor/lib/modules # 
$ ifconfig -a  #存在wlan0表示ko文件加载成功#查看ip地址
$ adb shell ip addr show wlan0console:/ # ip addr show wlan0                                                 
8: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether e2:c8:ad:df:ab:2c brd ff:ff:ff:ff:ff:ffinet 192.168.3.20/24 brd 192.168.3.255 scope global wlan0valid_lft forever preferred_lft foreverinet6 fe80::db7f:3aa:13f5:c909/64 scope link stable-privacy valid_lft forever preferred_lft forever
console:/ # 
192.168.3.20  就是ip

第三部分

主副屏属性配置(HDMI-A/eDP/DP/LVDS/DPI/DSI)
Main/Aux panel property configuration (HDMI-A/eDP/DP/LVDS/DPI/DSI)
device/rockchip/common/ system.prop
sys.hwc.device.primary=eDP
sys.hwc.device.extend=HDMI-A#播放
$ tinyplay /sdcard/jiazhou-hostel.wav  -D 0 -d 0 -p 1024 -n 3#查看display信息
$ cat d/dri/0/summary#查看cpu频率
$ cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq#OTG的模式切换
$ find -name otg > /dev/null
$ cat  /sys/devices/platform/ff2c0000.syscon/ff2c0000.syscon:usb2-phy@100/otg_mode
$ echo host > /sys/devices/platform/ff2c0000.syscon/ff2c0000.syscon:usb2-phy@100/otg_mode
$ echo otg > /sys/devices/platform/ff2c0000.syscon/ff2c0000.syscon:usb2-phy@100/otg_mode#查看蓝牙状态
$ adb shell settings get global bluetooth_on   #获取蓝牙的开关
$ adb shell settings put global  ADB_ENABLED 1 #使能adb的开关
$ adb shell settings put secure adb_enable     #使能adb的使能#打开蓝牙设置
adb shell am start -a android.settings.BLUETOOTH_SETTINGS #打开蓝牙的设置#系统旋转
$ busybox vi vendor/default.prop
[ro.surface_flinger.primary_display_orientation]: [ORIENTATION_90]

第四部分

1. 获取内部版本号: adb shell getprop ro.build.display.innerver
2. 获取按键值: adb shell getevent
3. 获取apk信息: adb shell dumpsys package 包名 ->info.txt
4. 获取应用包名:adb shell dumpsys window windows | grep mFocusedApp  或者 adb shell dumpsys window windows | findstr mFocusedApp
5. 打开WiFi设置界面:adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
6. 打开热点设置界面:adb shell am start -n com.android.settings/.TetherSettings
7. 查询蓝牙是否开启:
adb shell settings get global bluetooth_on   返回结果0代表关闭,1代表开启
adb shell dumpsys bluetooth_manager | findstr enabled     返回结果是true或者false,说明开启或关闭
8. 查询WiFi是否开启:adb shell settings get global wifi_on     返回结果0代表关闭,1代表开启 
9. 查询蓝牙地址:adb shell settings get secure bluetooth_address
10. 查询WiFi地址:adb shell cat /sys/class/net/wlan0/address
11. 开启WiFi:adb shell svc wifi enable
12. 关闭WiFi:adb shell svc wifi disable
13. 打开蓝牙设置界面:adb shell am start -a android.settings.BLUETOOTH_SETTINGS
14. 获取手机休眠时间:adb shell settings get system screen_off_timeout
15. 更改手机休眠时间:adb shell settings put system screen_off_timeout 600000(10分钟)
16. 获取系统默认输入法:adb shell settings get secure default_input_method
17. 获取手机是否为自动亮度:adb shell settings get system screen_brightness_mode  (0代表非自动,1代表为自动)
18. 设置手机为自动调整亮度:adb shell settings put system screen_brightness_mode 1    
19. 获取手机当前亮度:adb shell settings get system screen_brightness
20. 设置手机亮度(0-255):adb shell settings put system screen_brightness 350
21. 打开定位设置界面:adb shell am start -a android.settings.LOCATION_SOURCE_SETTINGS
22. 开启定位:adb shell settings put secure location_providers_allowed +gps
23. 关闭定位:adb shell settings put secure location_providers_allowed -gps
24. 查看定位方式:adb shell settings get secure location_providers_allowed  (前提是位置信息开启)
25. 拨打电话:adb shell am start -a android.intent.action.CALL tel:8888888888888
26. 发送短信:adb shell am start -a android.intent.action.SENDTO -d sms:10086(发送目的号码) --es sms_body "hello"(短信内容) --ez exit_on_sent true 
27. 获取应用包名:adb shell dumpsys window windows | findstr  mFocusedApp 
28. 清除应用数据与缓存: adb shell pm clear cn.com.test.mobile
29. 启动应用: adb shell am start -n cn.com.test.mobile/.ui.SplashActivity 
30. 停止应用:adb shell am force-stop cn.com.test.mobile
31. 飞行模式:adb shell settings set global airplane_mode_on   (0==关闭,1==开启)
32. 开启飞行模式:adb shell settings put global airplane_mode_on 1
33. 手机震动测试(前提手机root):①adb shell ②echo '3000'>/sys/devices/virtual/timed_output/vibrator/enable
34. 向上滑:adb shell input touchscreen swipe 930 880 930 380 
35. 向下滑:adb shell input touchscreen swipe 930 380 930 880
36. 向右滑:adb shell input touchscreen swipe 330 880 930 880 
37. 向左滑:adb shell input touchscreen swipe 930 880 330 880
38. 模拟鼠标点击操作:adb shell input mouse tap 100 500
39. 长按:adb shell input swipe startX startY startX startY 500
40. 滑动解锁:adb shell input swipe 300 1000 300 500
41. 冷启动app:adb shell am start -W -n package/activity
42. 热启动:①停止app: adb shell input keyevent 3  ②adb shell am start -W -n package/activity
43. 查看内存占用情况:adb -s 设备号 shell top -m 进程数量 -n 数据的刷新次数 -s 按哪列进行排序 -d 刷新时间间隔(默认5秒)
44. 切换手机电池为非充电状态: adb shell dumpsys battery set status 1
45. 改变手机电量: adb shell dumpsys battery set level 58
46. 获取当前电量:adb shell cat /sys/class/power_supply/battery/capacity
47. 手机截屏:adb shell /system/bin/screencap -p /sdcard/screenshot.png
48. 录制屏幕:adb shell screenrecord --time-limit 10 /sdcard/demo.mp4
49. 获取手机型号:adb shell getprop ro.product.model
50. 获取电池信息:adb shell dumpsys battery  
51. 获取屏幕分辨率:adb shell wm size
52. 获取屏幕密度:adb shell wm density
53. 显示屏参数:adb shell dumpsys window displays
54. 获取手机IP地址:adb shell ifconfig | findstr Mask
55. 查看WiFi局域网地址:adb shell ifconfig wlan0
56. 显示区域位置:adb shell wm overscan 0,0,0,200  (四个数字分别表示距离左、上、右、下边缘的留白像素,以上命令表示将屏幕底部 200px 留白)
57. 恢复原显示区域命令:adb shell wm overscan reset
58. 获取USB调试模式:adb shell settings get global adb_enabled
59. 关闭USB调试模式:adb shell settings put global adb_enabled 0
60. 状态栏和导航栏的显示隐藏:
adb shell settings put global policy_control <key-values>
<key-values> 可由如下几种键及其对应的值组成,格式为 <key1>=<value1>:<key2>=<value2>。immersive.full----------同时隐藏immersive.status----------隐藏状态栏immersive.navigation----------隐藏导航栏immersive.preconfirms----------?
这些键对应的值可则如下值用逗号组合:apps----------所有应用*----------所有界面packagename----------指定应用-packagename----------排除指定应用
例如:
adb shell settings put global policy_control immersive.full=*
表示设置在所有界面下都同时隐藏状态栏和导航栏。
adb shell settings put global policy_control immersive.status=com.package1,com.package2:immersive.navigation=apps,-com.package3
表示设置在包名为 com.package1 和 com.package2 的应用里隐藏状态栏,在除了包名为 com.package3 的所有应用里隐藏导航栏。
61. 打开网页: adb shell am start -a android.intent.action.VIEW -d http://www.baidu.com
62. 查看通信日志 :adb logcat -b radio (常用于查看详细的通话状态)
63. 获取界面控件:adb uiautomator dump
64. 列出输入法:adb shell ime list -s 
65. 永不休眠:adb shell settings put system screen_off_timeout 2147483647
66. 关闭\打开自动旋转:adb shell settings put system accelerometer_rotation 0\1

第五部分

#调试屏的时候的屏参展现
eg.1
console:/ # cat d/dri/0/summary                                                
VOP [ff460000.vop]: ACTIVEConnector: DSIbus_format[100a]: RGB888_1X24overlay_mode[0] output_mode[0] color_space[0]Display mode: 720x1280p61clk[62000] real_clk[62000] type[48] flag[a] // clk[62000] 62000,000H: 720 740 741 761         //ht ht+hbp  ht+hfp+hsync ht+hbp+hfp+hsyncV: 1280 1310 1311 1341     //vt vt+vbp  vt+vfp+vsync vt+hbp+hfp+vsyncwin0-0: DISABLEDwin1-0: DISABLEDwin2-0: ACTIVEformat: AB24 little-endian (0x34324241) SDR[0] color_space[0]csc: y2r[0] r2r[0] r2y[0] csc mode[0]zpos: 0src: pos[0x0] rect[720x1280]dst: pos[0x0] rect[720x1280]buf[0]: addr: 0x0000000000708000 pitch: 2880 offset: 0win2-1: DISABLEDwin2-2: DISABLEDwin2-3: DISABLEDpost: sdr2hdr[0] hdr2sdr[0]pre : sdr2hdr[0]post CSC: r2y[0] y2r[0] CSC mode[1]
VOP [ff470000.vop]: DISABLED
console:/ # timing0: timing0 {	 clock-frequency = <62000000>;vactive = <1280>;hactive = <720>;vfront-porch = <30>;vsync-len = <1>;vback-porch = <30>;hfront-porch = <20>;hsync-len = <1>;hback-porch = <20>;hsync-active = <0>;vsync-active = <0>;de-active = <0>;pixelclk-active = <0>;};eg.2
console:/ # cat d/dri/0/summary                                                
VOP [ff460000.vop]: ACTIVEConnector: DSIbus_format[100a]: RGB888_1X24overlay_mode[0] output_mode[0] color_space[0]Display mode: 720x1280p61clk[62000] real_clk[62000] type[48] flag[a]H: 720 739 740 760V: 1280 1309 1310 1340win0-0: DISABLEDwin1-0: DISABLEDwin2-0: ACTIVEformat: AB24 little-endian (0x34324241) SDR[0] color_space[0]csc: y2r[0] r2r[0] r2y[0] csc mode[0]zpos: 0src: pos[0x0] rect[720x1280]dst: pos[0x0] rect[720x1280]buf[0]: addr: 0x00000000010cc000 pitch: 2880 offset: 0win2-1: DISABLEDwin2-2: DISABLEDwin2-3: DISABLEDpost: sdr2hdr[0] hdr2sdr[0]pre : sdr2hdr[0]post CSC: r2y[0] y2r[0] CSC mode[1]
VOP [ff470000.vop]: DISABLED
console:/ # timing0: timing0 {	 
clock-frequency = <62000000>;
vactive = <1280>;
hactive = <720>;
vfront-porch = <29>;
vsync-len = <1>;
vback-porch = <30>;
hfront-porch = <19>;
hsync-len = <1>;
hback-porch = <20>;
hsync-active = <0>;
vsync-active = <0>;de-active = <0>;pixelclk-active = <0>;};

http://www.mrgr.cn/news/35172.html

相关文章:

  • 中国科学院云南天文台博士招生目录
  • 宠物空气净化器去浮毛哪家强?希喂、美的和米家实测分享
  • 编曲为什么这么难学 编曲应该从何下手,想要学习编曲,一定要有扎实的乐理基础知识
  • 汽车售后诊断ECU参数分析
  • Leetcode 反转链表
  • 怎么把照片转换成jpg格式?这5种转换方法简单高效
  • MNE读取数据单位问题
  • akamai解混淆(ast)
  • 穿透式薪酬监管,红海云打造“三全”数智化薪酬管理系统
  • 近千亿市场开卷!AutoDisplay Week 2024车载显示产业周开放注册!
  • 性能测试工具——JMeter
  • vue2若依项目打包部署页面不请求或404
  • vant Uploader 文件上传 修改上传icon样式
  • Qt:关于16进制数转化那些事
  • 如何配置路由器支持UDP
  • Spring Boot 学习之路 -- 基础认知
  • Unity 百度AI实现无绿幕拍照抠像功能(详解版)
  • 统一建模语言(UML)在软件研发过程中常用图接受:类图、用例图、时序图、状态图、活动图、流程图、顺序图
  • 什么是BOM?
  • 【Kubernetes】常见面试题汇总(三十六)