【基础工具篇使用】ADB 的安装和使用

文章目录

  • ADB的命令安装
  • ADB 命令使用
    • 查看帮助 ——adb help
    • 查看连接设备

ADB的命令安装

ADB 命令的全称为“Android Debug Bridge”,从英文中看出主要是用作安卓的调试工具。ADB 命令在嵌入式开发中越来越常用了
在 Windows 上按“win”+“R”组合件打开运行, 输入 sysdm.cpl
在这里插入图片描述
接着我们可以把 ADB 的路径添加到系统变量里面
在这里插入图片描述
运行 CMD 终端,输入命令进行检验是否安装成功

adb version

在这里插入图片描述

ADB 命令使用

查看帮助 ——adb help

C:\Users\zoe>adb help
Android Debug Bridge version 1.0.41
Version 33.0.3-8952118
Installed as G:\Program Files (x86)\platform-tools_r33.0.3-windows\platform-tools\adb.exeglobal options:-a                       listen on all network interfaces, not just localhost-d                       use USB device (error if multiple devices connected)-e                       use TCP/IP device (error if multiple TCP/IP devices available)-s SERIAL                use device with given serial (overrides $ANDROID_SERIAL)-t ID                    use device with given transport id-H                       name of adb server host [default=localhost]-P                       port of adb server [default=5037]-L SOCKET                listen on given socket for adb server [default=tcp:localhost:5037]--one-device SERIAL|USB  only allowed with 'start-server' or 'server nodaemon', server will only connect to one USB device, specified by a serial number or USB device address.--exit-on-write-error    exit if stdout is closedgeneral commands:devices [-l]             list connected devices (-l for long output)help                     show this help messageversion                  show version numnetworking:connect HOST[:PORT]      connect to a device via TCP/IP [default port=5555]disconnect [HOST[:PORT]]disconnect from given TCP/IP device [default port=5555], or allpair HOST[:PORT] [PAIRING CODE]pair with a device for secure TCP/IP communicationforward --list           list all forward socket connectionsforward [--no-rebind] LOCAL REMOTEforward socket connection using:tcp:<port> (<local> may be "tcp:0" to pick any open port)localabstract:<unix domain socket name>localreserved:<unix domain socket name>localfilesystem:<unix domain socket name>dev:<character device name>jdwp:<process pid> (remote only)vsock:<CID>:<port> (remote only)acceptfd:<fd> (listen only)forward --remove LOCAL   remove specific forward socket connectionforward --remove-all     remove all forward socket connectionsreverse --list           list all reverse socket connections from devicereverse [--no-rebind] REMOTE LOCALreverse socket connection using:tcp:<port> (<remote> may be "tcp:0" to pick any open port)localabstract:<unix domain socket name>localreserved:<unix domain socket name>localfilesystem:<unix domain socket name>reverse --remove REMOTE  remove specific reverse socket connectionreverse --remove-all     remove all reverse socket connections from devicemdns check               check if mdns discovery is availablemdns services            list all discovered servicesfile transfer:push [--sync] [-z ALGORITHM] [-Z] LOCAL... REMOTEcopy local files/directories to device--sync: only push files that are newer on the host than the device-n: dry run: push files to device without storing to the filesystem-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)-Z: disable compressionpull [-a] [-z ALGORITHM] [-Z] REMOTE... LOCALcopy files/dirs from device-a: preserve file timestamp and mode-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)-Z: disable compressionsync [-l] [-z ALGORITHM] [-Z] [all|data|odm|oem|product|system|system_ext|vendor]sync a local build from $ANDROID_PRODUCT_OUT to the device (default all)-n: dry run: push files to device without storing to the filesystem-l: list files that would be copied, but don't copy them-z: enable compression with a specified algorithm (any/none/brotli/lz4/zstd)-Z: disable compressionshell:shell [-e ESCAPE] [-n] [-Tt] [-x] [COMMAND...]run remote shell command (interactive shell if no command given)-e: choose escape character, or "none"; default '~'-n: don't read from stdin-T: disable pty allocation-t: allocate a pty if on a tty (-tt: force pty allocation)-x: disable remote exit codes and stdout/stderr separationemu COMMAND              run emulator console commandapp installation (see also `adb shell cmd package help`):install [-lrtsdg] [--instant] PACKAGEpush a single package to the device and install itinstall-multiple [-lrtsdpg] [--instant] PACKAGE...push multiple APKs to the device for a single package and install theminstall-multi-package [-lrtsdpg] [--instant] PACKAGE...push one or more packages to the device and install them atomically-r: replace existing application-t: allow test packages-d: allow version code downgrade (debuggable packages only)-p: partial application install (install-multiple only)-g: grant all runtime permissions--abi ABI: override platform's default ABI--instant: cause the app to be installed as an ephemeral install app--no-streaming: always push APK to device and invoke Package Manager as separate steps--streaming: force streaming APK directly into Package Manager--fastdeploy: use fast deploy--no-fastdeploy: prevent use of fast deploy--force-agent: force update of deployment agent when using fast deploy--date-check-agent: update deployment agent when local version is newer and using fast deploy--version-check-agent: update deployment agent when local version has different version code and using fast deploy(See also `adb shell pm help` for more options.)uninstall [-k] PACKAGEremove this app package from the device'-k': keep the data and cache directoriesdebugging:bugreport [PATH]write bugreport to given PATH [default=bugreport.zip];if PATH is a directory, the bug report is saved in that directory.devices that don't support zipped bug reports output to stdout.jdwp                     list pids of processes hosting a JDWP transportlogcat                   show device log (logcat --help for more)security:disable-verity           disable dm-verity checking on userdebug buildsenable-verity            re-enable dm-verity checking on userdebug buildskeygen FILEgenerate adb public/private key; private key stored in FILE,scripting:wait-for[-TRANSPORT]-STATE...wait for device to be in a given stateSTATE: device, recovery, rescue, sideload, bootloader, or disconnectTRANSPORT: usb, local, or any [default=any]get-state                print offline | bootloader | deviceget-serialno             print <serial-number>get-devpath              print <device-path>remount [-R]remount partitions read-write. if a reboot is required, -R willwill automatically reboot the device.reboot [bootloader|recovery|sideload|sideload-auto-reboot]reboot the device; defaults to booting system image butsupports bootloader and recovery too. sideload rebootsinto recovery and automatically starts sideload mode,sideload-auto-reboot is the same but reboots after sideloading.sideload OTAPACKAGE      sideload the given full OTA packageroot                     restart adbd with root permissionsunroot                   restart adbd without root permissionsusb                      restart adbd listening on USBtcpip PORT               restart adbd listening on TCP on PORTinternal debugging:start-server             ensure that there is a server runningkill-server              kill the server if it is runningreconnect                kick connection from host side to force reconnectreconnect device         kick connection from device side to force reconnectreconnect offline        reset offline/unauthorized devices to force reconnectusb:attach                   attach a detached USB devicedetach                   detach from a USB device to allow use by other processes
environment variables:$ADB_TRACEcomma-separated list of debug info to log:all,adb,sockets,packets,rwx,usb,sync,sysdeps,transport,jdwp$ADB_VENDOR_KEYS         colon-separated list of keys (files or directories)$ANDROID_SERIAL          serial number to connect to (see -s)$ANDROID_LOG_TAGS        tags to be used by logcat (see logcat --help)$ADB_LOCAL_TRANSPORT_MAX_PORT max emulator scan port (default 5585, 16 emus)$ADB_MDNS_AUTO_CONNECT   comma-separated list of mdns services to allow auto-connect (default adb-tls-connect)

查看连接设备

当使用 adb devices 列出只有一个连接设备的时候,可以不用加-s < serialNumber >指定设备,默认就会使用设备。
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/334315.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

QT DAY1作业

1.QQ登录界面 头文件代码 #ifndef MYWIDGET_H #define MYWIDGET_H#include <QWidget> #include <QIcon> #include <QLabel> #include <QPushButton> #include <QMovie> #include <QLineEdit>class MyWidget : public QWidget {Q_OBJECTpu…

混淆技术概论

混淆技术概论 引言 在逆向工程领域&#xff0c;混淆技术是一种非常重要的技术手段&#xff0c;通过打破人们的思维惯性&#xff0c;使得逆向分析变得更加困难。本文将会介绍混淆技术的概念、分类及其应用&#xff0c;以及如何使用IPA Guard进行iOS IPA重签名。 混淆技术概述…

熟悉HDFS常用操作

1. 利用Hadoop提供的Shell命令完成下列任务 (1)向HDFS中上传任意文本文件,如果指定的文件在HDFS中已经存在,由用户指定是追加到原有文件末尾还是覆盖原有的文件。 #检查文件是否存在./bin/hdfs dfs -test -e text.txt echo $? #结果是1 代表已存在 #根据结果判断出文件已存…

微信小程序canvas画布实现矩形元素自由缩放、移动功能

获取画布信息并绘制背景 .whml <canvas class="canvas" type="2d" id="myCanvas" bindtouchstart="get_rect_touch_position" bindtouchmove="move_or_scale" bind:tap="finish_edit_check"/> .wxss .c…

【互联网安全架构】渗透测试及常见的Web攻击手段

1.网络安全和渗透测试 &#xff08;1&#xff09;什么是网络安全 网络防御主要是针对各类网络攻击提供网络安全防御方案&#xff0c;为了应对攻击技术的不断革新&#xff0c;防御技术已经逐步从被动防御的历史阶段转变为主动防御阶段。目前常见的网络防御技术大体类型有加密技…

企业培训系统源码:构建智能、可扩展的学习平台

企业培训系统在现代企业中扮演着至关重要的角色。本文将通过深度解析企业培训系统的源码&#xff0c;介绍如何构建一个智能、可扩展的学习平台&#xff0c;涉及关键技术和代码实例。 1. 技术栈选择与项目初始化 在构建企业培训系统之前&#xff0c;选择适当的技术栈是至关重…

STL标准库与泛型编程(侯捷)笔记6(完结)

STL标准库与泛型编程&#xff08;侯捷&#xff09; 本文是学习笔记&#xff0c;仅供个人学习使用。如有侵权&#xff0c;请联系删除。 参考链接 Youbute: 侯捷-STL标准库与泛型编程 B站: 侯捷 - STL Github:STL源码剖析中源码 https://github.com/SilverMaple/STLSourceCo…

【代码随想录】刷题笔记Day48

前言 早上练车去了&#xff08;好久没有8点前醒了&#xff09;&#xff0c;练科目二两小时下来脚根可真酸啊&#xff0c;希望下周一把过。练完顺带去Apple西湖免费换新了耳机&#xff0c;羊毛爽&#xff01; 121. 买卖股票的最佳时机 - 力扣&#xff08;LeetCode&#xff09;…

【信息安全】深度分析邮件安全及钓鱼攻击防范

本博文共计3100余字&#xff0c;预计需阅读20分钟 【邮件安全建设】 一、前言 邮件系统作为企业办公网络架构中重要的组成部分&#xff0c;同时也是业务高频使用的办公应用&#xff0c;一旦出现安全问题&#xff0c;业务将会被严重干扰甚至中断&#xff0c;本篇博客通过攻守两…

为什么选择嬴图?

图数据库、图计算、图中台都是用图论的方式去构造实体间的关联关系&#xff0c;实体用顶点来表达&#xff0c;而实体间的关系用边来表达。图数据库的这种简洁、自由、高维但100%还原世界的数据建模的方式让实体间的关联关系的计算比SQL类的数据库高效成千上万倍。 图&#xff1…

HarmonyOS应用开发者基础认证考试

判断题 1.Ability是系统调度应用的最小单元,是能够完成一个独立功能的组件。一个应用可以包含一个或多个Ability。 正确(True) 2.所有使用Component修饰的自定义组件都支持onPageShow,onBackPress和onPageHide生命周期函数。 错误(False) 3.每调用一次router.pushUrl()方法,…

vue无法获取dom

处理过程 watch监听值变化 index.js:33 [Vue warn]: Error in callback for watcher "$store.state.modelsStorageUrl": "TypeError: Cannot set properties of undefined (setting modelScene)"watch: {"$store.state.modelsStorageUrl":{ha…