adb 常用命令
日志 adb shell logcat > d:\log.txt
安裝 adb install -r -d path.apk
输入 adb shell input text Ecarx@2021
查看apk版本
adb shell "dumpsys package com.android.systemui | grep version"
adb shell "dumpsys package com.ecarx.car.launcher | grep version"
adb shell "dumpsys package com.ecarx.compositorui | grep version"
adb shell "dumpsys package com.ecarx.xiaokagui | grep version" 语音包
查看已安装应用
adb shell pm list packages
投屏工具 副屏
scrcpy-noconsole.exe --display=2
查看窗口window信息
adb shell dumpsys window windows > d:\window.log
查看焦点窗口
查看运行中的进程
adb shell "ps | grep com.ecarx"
adb shell "ps | grep com.ecarx.mul"
adb shell "ps | grep monkey"
使用以下指令可以获取CPU数量以及序列号:
adb shell cat /proc/cpuinfo
打开应用
1、原生设置: adb shell am start -W -n com.android.settings/com.android.settings.Settings
2、ecarx设置:adb shell am start -W -n ecarx.settings/ecarx.settings.setting.CarSettingActivity
3、彩蛋: adb shell am start -W -n com.ecarx.compositorui/com.ecarx.compositorui.activity.MainActivity
通过adb intent打开应用?????
带参数的广播 string boolean int
adb shell am broadcast -a com.example.MY_BROADCAST_ACTION_CAMERA --ez SHOW_CAMERA true
adb shell am broadcast -a action.statusbar.show.Dialog --ei intkey 1 --es SlotModel bluetooth --ez isVr true
adb shell am broadcast -n com.ecarx.compositorui/.receiver.LocationShareReceiver -a ecarx.intent.action.RECOMMENDATION_LOCATION_RECEIVER --es locationName "武汉经济开发区华中中交城" --ez isLauncher false --es lat 30.50547 --es lng 114.204521 --es tpIdentity 0
adb shell am broadcast -n com.ecarx.compositorui/.receiver.LocationShareReceiver -a ecarx.intent.action.LocationShareReceiver --es locationName "武汉经济开发区华中中交城" --es lat 30.50547 --es lng 114.204521 --es tpIdentity "0" --ez isLauncher false
adb shell am broadcast -n com.ecarx.compositor/.push.LocationPushReceiver -a ecarx.intent.action.LocationPushReceiver --es locationName "武汉经济开发区华中中交城" --es lat 30.50547 --es lng 114.204521 --es tpIdentity "0" --ez isLauncher false
地图推送广播
adb shell am broadcast -n com.ecarx.compositor/.push.LocationPushReceiver -a ecarx.intent.action.LocationPushReceiver --es locationName "杭州湾吉利研究院区" --es lat 30.50547 --es lng 114.204521 --es tpIdentity "0" --ez isLauncher false
adb shell am broadcast -n com.ecarx.compositor/.push.RecommendPushReceiver -a ecarx.intent.action.PUSH_RECEIVER --ei type 10001 --es signature C9AAE1A9A93164F90F5376189D8C5438E04DAF2D --es payload {"tts":"","sourcePackage":"com.ecarx.compositorui","style":{"duration":"300","rank":"1","type":"6"},"id":"747813593729302528","category":"system","event":[{"package":"com.ecarx.compositorui","appType":"","extral":"","typeName":"","action":"ecarx.intent.action.RECOMMENDATION_VIDEO","className":"com.ecarx.compositorui.activity.VideoPlayActivity","id":0,"packageName":"","params":[{"value":"activity","key":"type"}],"uri":"xc:\/\/compositor.ecarx.com\/openvideo\/?contentid=10002735&trigger=3","bgUrl":""}],"content":{"detailTxt":"111111111111111111111","text":"111111111111111111111","title":"愚人节快乐哈哈哈哈","btnInfo":"go"}}
adb shell am broadcast -a ecarx.intent.action.PUSH_RECEIVER --ei type 10001 --eba signature C9AAE1A9A93164F90F5376189D8C5438E04DAF2D --es payload {"tts":"","sourcePackage":"com.ecarx.compositorui","style":{"duration":"300","rank":"1","type":"6"},"id":"747813593729302528","category":"system","event":[{"package":"com.ecarx.compositorui","appType":"","extral":"","typeName":"","action":"ecarx.intent.action.RECOMMENDATION_VIDEO","className":"com.ecarx.compositorui.activity.VideoPlayActivity","id":0,"packageName":"","params":[{"value":"activity","key":"type"}],"uri":"xc:\/\/compositor.ecarx.com\/openvideo\/?contentid=10002735&trigger=3","bgUrl":""}],"content":{"detailTxt":"111111111111111111111","text":"111111111111111111111","title":"愚人节快乐哈哈哈哈","btnInfo":"go"}}
adb shell am broadcast -n com.ecarx.compositor/.push.LocationPushReceiver -a ecarx.intent.action.PUSH_RECEIVER --es payload {"tts":"0","sourcePackage":"com.ecarx.compositorui","style":{"duration":"300","rank":"1","type":"6"},"id":"747813593729302528","category":"system","event":[{"package":"com.ecarx.compositorui","appType":"-1","extral":"-1","typeName":"-1","action":"ecarx.intent.action.RECOMMENDATION_VIDEO","className":"com.ecarx.compositorui.activity.VideoPlayActivity","id":0,"packageName":"com.ecarx.compositorui","params":[{"value":"activity","key":"type"}],"uri":"xc:\/\/compositor.ecarx.com\/openvideo\/?contentid=10002735&trigger=3","bgUrl": "1"}],"content":{"detailTxt":"111111111111111111111","text":"111111111111111111111","title":"愚人节快乐哈哈哈哈","btnInfo":"go"}}
adb shell am broadcast -n com.ecarx.compositor/.push.LocationPushReceiver -a ecarx.intent.action.PUSH_RECEIVER --es payload \"{"pushContentType":2,"videoMd5":"51b863ea0e3cc9c905f23ddd13d296af","pushCmd":1,"videoType":1,"title":"生日快乐啊","priority":0,"videoSize":20190131,"styleType":13,"videoUrl":"https:\/\/gstore-static.zeekrline.com\/testing\/202207\/1658718321650\/EVA_music高码率10.mp4","sceneCode":"00","videoName":"EVA_music高码率10.mp4","operationId":"EasterEggs_1","startTime":1658718274000,"id":"10002739","endTime":1659236674000}\"
下载彩蛋并播放 ndk.dir=D\:\\sdk\\ndk\\25.1.8937393 sdk.dir=D\:\\sdk
adb shell am start -a ecarx.intent.action.RECOMMENDATION_VIDEO --es recommendations_egg_uri_key "xc://compositor.ecarx.com/openvideo/?contentid=10002740\&trigger=3"
高清:
adb shell am start -a ecarx.intent.action.RECOMMENDATION_VIDEO --es recommendations_egg_uri_key "xc://compositor.ecarx.com/openvideo/?contentid=10002774\&trigger=3"
adb shell am start -W -n com.ecarx.compositorui/com.ecarx.compositorui.activity.VlcVideoPlayActivity --es recommendations_egg_uri_key "xc://compositor.ecarx.com/openvideo/?contentid=10002774\&trigger=3"
强制关闭应用
adb shell am force-stop com.ecarx.smartarea
打开布局边界
adb shell setprop debug.layout true
adb shell ps|findstr systemui
adb shell kill 77777
adb shell setprop debug.layout false
测试下载彩蛋
adb shell am broadcast -n com.ecarx.compositor/.push.LocationPushReceiver1 -a ecarx.intent.action.PUSH_RECEIVER_TEST
结果:下载到storage/emulated/0/egg_video_folder/
设置CC值
adb shell vehicle-hal-tool --get -p carconfig186 原始值1
adb shell vehicle-hal-tool --set 2 -p carconfig186
板载和tcam设置
1.adb root adb shell setprop persist.service.wifi.tcam false
2.setprop persist.service.wifi.tcam true(tcam)
setprop persist.service.wifi.tcam false(板载)
3. 查询当前wifi模式 adb shell getprop persist.service.wifi.tcam
测试环境
adb shell setprop persist.sys.tsp_env testing
adb shell getprop persist.sys.tsp_env
获取pcode 、IHUID
adb shell getprop persist.device.pcode
adb shell setprop persist.device.pcode DHU611L
adb shell getprop persist.device.ihuid
切换日夜模式
adb shell cmd uimode night no
切换成黑夜模式:
adb shell "su 0 cmd uimode night yes"
切换成白天模式:
adb shell "su 0 cmd uimode night no"
耗CPU操作
adb shell logcat -b main,system,crash,events -a -f /data/log/log_logcat@20220831_05-24-08-308-PC_173.log -r20480 -n 400 -v threadtime
跑monkey
adb shell monkey -s 1000 --pct-touch 30 --throttle 500 -p ecarx.settings --ignore-crashes --monitor-native-crashes --ignore-timeouts --pct-syskeys 0 -v 2880000 > /sdcard/monkey/ecarx.settings.txt
adb shell monkey -s 1003 --pct-touch 30 --throttle 500 -p com.ecarx.appstore -p com.ecarx.smartarea --ignore-crashes --monitor-native-crashes --ignore-timeouts --pct-syskeys 0 -v -v -v 20000 > D:\monkey_log.txt
结束monkey
adb shell "ps | grep monkey" 得到pid
adb shell kid pid