AS查看控件idSDK -> tools -> monitor.bat DDMS若看不了則:adb reamountadb root
MTK log:? *#9646633#
adb push? D:\log\fileName? /storage/emulated/0adb install -t path? 強(qiáng)制安裝adb install -r path? 替換安裝adb shell am start -a android.media.action.STILL_IMAGE_CAMERA_SECURE? 強(qiáng)制啟動(dòng)安全相機(jī)
linux:adb shell dumpsys activity | grep "mFocusedActivity"
windows:adb shell dumpsys activity | findstr "mFocusedActivity"
adb push xxxx.apk /system/app/Camera
抓Log抓取所有LOG命令:adb logcat –v time > d:\log.txt? ? ? ? ? ? ? ? ? ? ? ? ? ? -v threadtime adb shell logcat > a.txt 抓取應(yīng)用層LOG命令:adb logcat –b main –v time >d:\main.txt抓取死機(jī)勺美、重啟LOG命令: adb shell dumpsys > d:/dump.txt
kill -3 cameraAppPiddata/anr沒(méi)有trace文件
logcat | grep -e? onAction -e notifyAction 抓多個(gè)關(guān)鍵字
adb -s H623CB7J01234567 shell dumpsys meminfo com.transsion.camera 查看指定設(shè)備內(nèi)存使用情況查看進(jìn)程:adb shell 進(jìn)入shell模式logcat | grep "xxxx"ps -A | grep "camera"
"logcat read: unexpected EOF"cadb logcat -G 5madb logcat -c
"error: more than one device/emulator"adb kill-servertaskkill /f /im adb.exe
adb shell dumpsys window | grep mCurrentFocus 看下current focus window信息
抓內(nèi)存adb shell dumpsys meminfo com.transsion.cameraadb shell dumpsys meminfo |grep camerahalserveradb shell dumpsys activity | grep "aaa"
抓系統(tǒng)值adb shell dumpsys media.camera | grep -A 1 "android.control.enableZsl"adb shell dumpsys media.camera | grep -A 1 "android.control.afAvailableModes"
adb shell dumpsys media.camera | grep -A 1 "com.mediatek.control.capture.early.notification.support"
com.android.internal.app.ChooserActivity當(dāng)Activity被另一個(gè)透明或者 Dialog 樣式的 Activity 覆蓋時(shí)的狀態(tài)。此時(shí)它依然與窗口管理器保持連接橘茉,系統(tǒng)繼續(xù)維護(hù)其內(nèi)部狀態(tài)赋焕,所以它仍然可見(jiàn),但它已經(jīng)失去了焦點(diǎn)故不可與用戶交互批什,所以被覆蓋的Activity并不會(huì)執(zhí)行onStop()方法难捌。
1.在清單文件manifreast.xml中,找到對(duì)應(yīng)的activity添加 android:exported="true"屬性
2.adb shell am start -n com.transsion.camera.debug/com.transsion.camera.app.CameraActivity
adb pull <手機(jī)路徑>? <本機(jī)路徑>? 從手機(jī)中拉取信息到本地電腦上adb push <本機(jī)路徑>? <手機(jī)路徑>? 從本地電腦推送信息到手機(jī)上
adb pull /sdcard/FaceEmoji? C:\Users\yong.zhou1\Desktopdebugloggermtklog
adb shell am dumpheap com.transsion.camera /data/local/tmp/1.heapadb pull /data/local/tmp/ + 電腦文件夾路徑
adb pull /sdcard/aiworks/ C:\Users\yong.zhou1\Desktop
adb shell am start -a android.media.action.STILL_IMAGE_CAMERA_SECURE
adb shell logcat > C:\Users\yong.zhou1\Desktop\a.txt
獲取屏幕參數(shù)adb shell dumpsys window displays
內(nèi)存泄漏:一:抓取JavaHeap1.adb命令:adb shell am dumpheap com.transsion.camera /data/local/tmp/1.heapadb pull /data/local/tmp/ + 電腦文件夾路徑2.使用Android Profiler工具抓取Profiler -> + ->選擇對(duì)應(yīng)的手機(jī)的應(yīng)用進(jìn)程->MEMORY選項(xiàng)->dump Java heap
二:分析hprof文件hprof-conv? 原始hprof文件路徑? 新生成的hprof文件路徑
打開(kāi)mtk log囚聚,電話撥暗碼*#9646633#,進(jìn)入工程模式-> Log and Debugging -> DebugLoggerUI -> 點(diǎn)擊上面的設(shè)置按鍵->使能Mobile 和Enable Tag Log
adb push F:\log.7z /sdcard/
殺死相機(jī)服務(wù)
adb shell "ps -ef|grep cameraser|grep -v grep|awk '{print $2}'|xargs kill -9"