• adb 常用命令详解


    1、把电脑上文件或目录copy到手机中:adb push <local> <remote>    - copy file/dir to device

      此处的<local>就是指电脑,<remote>就是指手机或者模拟器。此处需要注意的是,电脑上的路径是“C:”,手机上的是“/sdcard/”,两处的斜杠方向不同。

    2、把手机文件copy到电脑上:adb pull <remote> [<local>]  - copy file/dir from device

    3、安装apk:adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
                                     ('-r' means reinstall the app, keeping its data) 强制安装(在某些情况下可以已有些应用程序在运行或不可写,可加上此参数强制安装)
                                     ('-s' means install on SD card instead of internal storage) 安装到SD卡,非手机内存


    4、卸载apk:adb uninstall [-k] <package> - remove this app package from the device
                                     ('-k' means keep the data and cache directories) 卸载时保留配置和缓存文件

    5、查看手机系统的具体命令:adb shell 

      adb shell getprop:查看机器的全部信息参数(硬件信息到所刷的ROM版本信息)。 

      adb shell getprop ro.serialno:查看机器的SN号

      adb shell setprop persist.service.thermal 0 修改信息参数

    6、等待设备接入:  adb wait-for-device          - block until device is online

    7、可以与其他命令连用:adb wait-for-device install <app>.apk

    8、启动adb服务进程:  adb start-server             - ensure that there is a server running

    9、关闭adb服务进程:  adb kill-server              - kill the server if it is running

    10、获取设备的当前状态:  adb get-state                - prints: offline | bootloader | device

    11、获取SN number:  adb get-serialno             - prints: <serial-number>

    12、重新挂载系统分区,使系统分区重新可写: adb remount

                      - remounts the /system partition on the device read-write

    13、重启设备:adb reboot [bootloader|recovery]   - reboots the device, optionally into the bootloader or recovery program 直接重启设备回到使用界面

           adb reboot-bootloader        - reboots the device into the bootloader  重启设备到bootloader引导模式

          adb reboot recovery 重启到recovery刷机模式

    14、获取管理员权限:  adb root                     - restarts the adbd daemon with root permissions

    15、至于adb shell am/pm的命令,请参考http://www.cnblogs.com/zh-ya-jing/p/4702411.html

    官方adb说明:http://developer.android.com/tools/help/adb.html

  • 相关阅读:
    编译器是C写的,包括一点C++,editor和debugger是C++写的(最早的16位编译器是纯汇编写的)
    2016 年美国大选,特朗普赢在哪儿?
    特朗普上台的原因:是经济全球化被甩出去人的反扑。但互联网时代不可阻挡,必须参与。开历史倒车是没用的,就像欧洲的羊吃人时代是一样的。信仰基督教以及美国传统价值观的那群老人,终归是要死去。
    Java 开发规约插件
    c#.net公共帮助类
    elasticsearch集群及filebeat server和logstash server
    NopCommerce源码架构
    局部函数
    C#实现人脸识别
    NET Core
  • 原文地址:https://www.cnblogs.com/yajing-zh/p/4702223.html
Copyright © 2020-2023  润新知