-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathandroid
104 lines (76 loc) · 3.8 KB
/
android
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
tags: [android, adb]
---
# enter system setting
adb shell am start -n com.android.settings/com.android.settings.Settings
# enter ehome setting
adb shell am start com.ehome.settings/.develop.DevelopActivity
# set ehome environment
adb shell setprop persist.vendor.ehome.enviroment qa
# monitor cpu frequency and temperature
watch -n 3 "cat /sys/class/thermal/thermal_zone0/temp && cat /sys/devices/system/cpu/cpu[0-3]/cpufreq/scaling_cur_freq"
# delete system app
pm uninstall
rm /system/vendor/app_dir
# monitor kernel dmesg
watch -n 2 "dmesg |grep usb"
# ehome setting app
adb install -r -t EHomeSettings_V1.0_20211220_studio_debug.apk
# get pcakge name by apk file
aapt.exe dump badging D:\company\project\firefly\Application\Android_sdk_demo_V5.2\PrintDemoV5.2.apk
# grep package name
pm list package |grep package's name
# grep activy with package
dumpsys package | grep -i package's name | grep Activity
# allow develop mode
adb shell settings put secure user_setup_complete 1
adb shell settings put global device_provisioned 1
# list service
service list |grep Alarm
# enter sleep mode
input keyevent 26
# get build variable
get_build_var TARGET_BUILD_VARIANT
get_build_var TARGET_PRODUCT
# change lcd density
adb shell wm density 320
# monitor input event
getevent -l
# list all installed packages
adb shell pm list packages
# get top activity
adb shell dumpsys activity top | grep ACTIVITY
# access mem
io -c 4 -l 4 0x
# cross compile application for android
CC=aarch64-linux-android30-clang ./configure --host=aarch64-linux-android --enable-tools --prefix=/tmp/gpio
make ARCH=arm64 CC=aarch64-linux-android30-clang CROSS_COMPILE=aarch64-linux-android-
# upload bugly so symbol information
java -jar buglyqq-upload-symbol.jar -appid xxx -appkey xxx -bundleid xcg.ehomepoct.io.zzcapp -version 1.2.4 -platform Android -inputSymbol D:\code\app\ehome\ehdriver\hardware\build\intermediates\cmake\debug\obj\armeabi-v7a
# use ndk-stack trace crash
adb logcat |ndk-stack.cmd -sym .\arm64-v8a\
# generate compile_commands.json
ninja -f out/combined-rk3568_ehome_ba200_a1.ninja -t compdb g.cc.cc > compile_commands_all.json
jq '[.[]|select(.file | startswith("art"))]' compile_commands_all.json > compile_commands.json
jq '[.[]|select(.file | startswith("art") or startswith("frameworks"))]' compile_commands_all.json > compile_commands-2.json
jq '[.[]|select(.file | contains("external/wpa_supplicant_8"))]' compile_commands_all.json > compile_commands.json
jq '[.[]|select(.file | contains("external/wpa_supplicant_8") or contains("external/camera_engine_rkaiq") or contains("external/libfuse") or contains("providers/MediaProvider") or startswith("frameworks") or startswith("bootable") or startswith("hardware") or startswith("system") or startswith("bionic"))]' compile_commands_all.json > compile_commands_1.json
# filter tests
jq '[.[]|select(.file | contains("tests") or contains("/test/") or contains("_test") |not)]' compile_commands_1.json > compile_commands.json
# 查看usb otg 当前模式
cat /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
# 设置usb otg 模式为device
echo peripheral > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
echo 2 > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
# 设置usb otg模式为host
echo host > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
echo 1 > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
# 默认为otg模式
echo otg > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
echo 0 > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode
# setup enable show point location
adb shell settings put system show_touches 1 && adb shell settings put system pointer_location 1
# view android framework source code by android-studio
aidegen frameworks hardware system packages -s -i s -p ~/download/android-studio
# adb logcat filter tag:log_level S:silent
adb logcat Camera2RawFragment:E *:S