adb 端口被占用,一种解决办法:
进入到 C:\Windows\System32>
C:\Windows\System32>adb nodaemon server
C:\Windows\System32>netstat -ano | findstr "5037"  //查看存在哪些进程
C:\Windows\System32>taskkill /f /pid 11524  //杀死所有进程

//查看顶端Activity命令
adb shell dumpsys activity top
adb shell dumpsys activity activities | sed -En -e '/Running activities/,/Run #0/p'
dumpsys activity | grep -i run

//查看应用的Activity打开速度
ActivityManager( 3698): Displayed org.codeaurora.snapcam/com.android.camera.CameraActivity

//查看内存使用情况
adb shell dumpsys meminfo org.codeaurora.gallery

//ubuntu 查看空间大小
free -h

//生成patch命令
git diff >patch.txt

//git查看基线
git log --graph

//查看屏幕分辨率
adb shell wm size  (1080*2280)

//linux中的一些命令
cd ~  //回到根目录

//手机进入fastbooter 模式
adb reboot bootloader

//快速编译system.img,可以使用这个命令:
#make systemimage

//快速编译boot.img,可以使用以下命令:
#make bootimage

//快速编译userdata.img,可以使用以下命令:
# make userdataimage-nodeps

//查看当前路径
pwd

//so中报错,通过地址解析命令
$ arm-linux-gnueabi-addr2line -f -e  camera.sdm660.so  0005e33e
      会得到这种结果:~QCamera3HardwareInterface  hardware/qcom/camera/QCamera2/HAL3/QCamera3HWI.cpp:675

//查看系统参数设置情况
adb shell
getprop | grep persist.vendor*
或者 cat /system/etc/prop.default

//满足任意关键字
logcat |grep -iE "A|B"
adb logcat | find/I "af_haf_process: state: GO_TO_DEST"

//查看CameraService进程Id
ps -ef | grep camera
kill  12345

//抓取kernel 中log
先输入命令 :*#0516#* 打开权限
adb shell cat /proc/kmsg > kernel.log

//拷贝当前目录下文件夹到指定目录
bin.liu1@ubuntu02:~$ cp -R ./. /mnt/code/bin.liu1/temp/

//把当前目录下你修改过的所有文件中的Tab制表符替换为4个空格
git status -s | xargs sed -i 's/\t/    /g'

//拷贝远程文件夹到本地
bin.liu@xa-zhong:~$ scp -r bin.liu1@10.100.99.44:/mnt/code/bin.liu1/temp/. ./  

//查看CPU信息
cat /proc/cpuinfo

//通过命令查找字符串
grep -rin "CameraActivity" ./  // r 表示递归查找; i 表示忽略大小写; n  表示显示行号; ./ 表示当前目录
grep -rnws CameraActivity . --include=*.java  //查看java文件中字符串CameraActivity
grep -rnws CameraActivity .

find  -name *.cpp|xargs grep -rnws isascii  //查找字符串
find -name *CameraA*     //查看文件名中包含CameraA的文件

//C++层log的输出,如果不全,可以调整log的级别:
adb shell dumpsys media.camera -v 1    //至少改成>=1。

start .   //打开当前文件夹

//手机连不上时可试一试
adb disable-verity
adb reboot

//可以用adb 发广播的方式验证,办法:
adb shell进手机
am broadcast -a com.andorid.BrowserDataConfig

//找到目标进程,并杀掉
adb shell 进入
ps |grep “mediaserver”
kill 1234

//grep 多条件过滤日志
logcat |grep AAA||BBB  //AAA 或者BBB 字符串中不能有空格

//查看手机应用累计流量的方法:
进入:/proc/net/xt_qtaguid目录
执行:cat stats

//刷机,单独刷某个img
adb reboot bootloader
fastboot flash boot  boot.img
fastboot flash system  system.img
fastboot flash userdata userdata.img
fastboot flash vendor vendor.img
fastboot reboot

//单独刷vendor.img 第二种方法
adb reboot bootloader
fastboot erase vendor_a
fastboot flash vendor_a .\vendor.img
fastboot erase vendor_b
fastboot flash vendor_b .\vendor.img
fastboot reboot

//monkey测试命令
adb shell monkey -p org.codeaurora.snapcam --throttle 1000 -s 252 --pct-anyevent 0 --pct-trackball 0 --pct-nav 0 --pct-majornav 2 --pct-appswitch 2 --ignore-timeouts --ignore-crashes --ignore-security-exceptions  -v -v 994809 > D:\monkey\S20i\monkey.txt


//打开Camera底层log
adb root
adb remount
adb shell setprop persist.vendor.camera.global.debug 5
adb shell setprop persist.vendor.camera.stats.aec.debug 5
adb shell setprop persist.vendor.camera.stats.awb.debug 5
adb shell setprop persist.vendor.camera.stats.af.debug 5
adb shell setprop persist.vendor.camera.stats.q3a.debug 5
adb shell setprop persist.vendor.camera.stats.haf.debug 5


adb shell setprop persist.vendor.camera.mci.debug 5
adb shell setprop persist.vendor.camera.hal.debug 5
adb shell setprop persist.vendor.camera.sensor.debug 5
adb shell setprop persist.vendor.camera.mct.debug 5
adb shell setprop persist.vendor.camera.isp.debug 5

3A log
adb shell setprop persist.vendor.camera.mobicat 2
adb shell setprop persist.vendor.camera.stats.debugexif 16711680

//使得Android Studio 自动下载功能需在host中添加如下配置(Win +R 然后在框中输入 C:\WINDOWS\system32\drivers\etc)
203.208.43.67 dl.google.com

//通过eclipse工具生成的trace.html打开时
先输入:chrome://tracing/  然后点击Load 加载trace.html文件

//git放弃本地修改,新加,和删除的
git checkout . && git clean -df

//修改git 中的编辑工具
git config --global core.editor vim

//高通文档下载
https://createpoint.qti.qualcomm.com

//通过命令打开相机(需要相机apk在xml中配置好)
    adb shell am start -a com.xxx.dusk.ddd.IMAGE_CAPTURE_0
    拍照:
    adb shell input keyevent 27
    自动对焦:
    adb shell input keyevent 80
    关闭:
    adb shell am force-stop com.xxx.dusk.ddd

更多相关文章

  1. GitHub 标星 2.5K+!教你通过玩游戏的方式学习 VIM!
  2. 如何在后台运行Linux命令?
  3. No.11 使用firewall配置的防火墙策略的生效模式
  4. 分支和循环(二)(零基础学习C语言)
  5. 一款霸榜 GitHub 的开源 Linux 资源监视器!
  6. Android的源代码下载教程-android学习之旅(102)
  7. Mac中用命令行启动AVD模拟器
  8. 获取Android系统中全部正在运行的程序
  9. Android跨进程唤醒APP,启动指定页面

随机推荐

  1. Android或win8 谁能在新互联网时代抗衡IO
  2. Android下利用SharePreference存储序列化
  3. 4.0 Android中资源文件
  4. Android Bitmap内存溢出问题解释
  5. 安卓开发之解决JS不能调用Android方法填
  6. android studio 导入工程慢
  7. Android Studio删除工程里面无用的代码和
  8. MVVMArchitecture,一款可配置的 MVVM 框架
  9. Android 微信分享,无需那么麻烦。
  10. android中的多线程基础问题