查看错误日志

    1. adb logcat -b crash

    安装App

    1. adb install <apk_path>

    卸载App

    adb uninstall <package_name>
    

    文件手机 -> 电脑

    adb pull <remote> <local>
    

    文件电脑 -> 手机

    adb push <local> <remote>
    

    清除App数据

    adb shell pm clear <package_name>
    

    启动App

    adb am start -a android.intent.action.VIEW -d http://www.google.com/
    am start -a android.settings.SETTINGS
    

    拨打电话

    adb am start -a android.intent.action.CALL -d tel:10086
    

    重启进入recovery或bootloader

    adb reboot [recovery | bootloader]
    

    显示activity相关的信息

    adb shell dumpsys activity
    

    显示状态栏相关的信息

    adb shell dumpsys statusbar
    

    使用程序的包名或者进程id显示内存信息

    adb shell dumpsys meminfo $package_name or $pid
    

    这条命令可以找出状态栏通知的包名,进而找到是哪个应用

    adb shell dumpsys statusbar | grep notification=Notification
    

    查看当前Activity

    adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'
    
    adb shell dumpsys activity top | grep ACTIVITY
    

    设置/清除HTTP代理

    adb shell settings put global http_proxy 192.168.199.141:8080
    adb shell settings put global http_proxy :0
    adb shell settings delete global http_proxy
    adb shell settings delete global global_http_proxy_host
    adb shell settings delete global global_http_proxy_port
    

    设置SELinux

    adb shell setenforce 0 //设置成permissive 模式
    adb shell setenforce 1 //设置成enforce 模式
    

    屏幕录像

    adb shell screenrecord "/path/to/record.mp4"
    
    1. adb shell dumpsys命令详解: http://gityuan.com/2016/05/14/dumpsys-command/

    SurfaceFlinger, accessibility, account, activity, alarm, appwidget, audio, backup, battery, batteryinfo, bluetooth, bluetooth_a2dp, clipboard, connectivity, content, cpuinfo, device_policy, devicestoragemonitor, diskstats, dropbox, entropy, hardware, hdmi, input_method, iphonesubinfo, isms, location, media.audio_flinger, media.audio_policy, media.camera, media.player, meminfo, mount, netstat, network_management, notification, package, permission, phone, power, search, sensor, simphonebook, statusbar, telephony.registry, throttle, uimode, usagestats, vibrator, wallpaper, wifi, window

    adb shell dumpsys -l
    
    //查看服务
    adb shell dumpsys activity services -p com.ysh.txht
    
    1. adb shell dumpsys gfxinfo http://blog.gaoyuan.xyz/2013/11/22/android-app-profile-tools/
    2. Apk Pull
      adb shell pm list packages -f | grep daxiang
      adb pull /data/app/org.idaxiang.android-1/base.apk ~/
    3. Open App Details:
      adb shell am start -a android.settings.APPLICATION_DETAILS_SETTINGS -d package:com.example

    微信相关:

    adb shell am start -a "android.intent.action.VIEW" -d "weixin://dl/scan"
    

    http://adbshell.com/

    http://www.cnblogs.com/pixy/p/4739040.html