ADB环境配置以及常用命令
本文描述ADB在MAC上的配置过程,以及常用的Command(ADB装x指南).更科学的Android SDK使用。
前情提要
- 请确保本地有 Android SDK,如无 请参见 Gradle环境配置一文
- 确保 SDK 中有 platform-tools,以下是我的配置路径
1 | keyle@keyles-MacBook-Pro ~/Library/Android/sdk/platform-tools ls -a |
配置MAC环境
打开terminal,在~
路径下输入下面命令
1 | //此命令写文本 |
关于ADB你不得不知道的8个命令 The Most Common ADB Commands You Must Know 译文
ADB对于Andorid实在是Debug的桥梁啊,它允许你使用你的电脑控制你的手机。这种情况下你想在桌面上给你的手机安装APP,你就该用ADB了。ADB可以干很多类似事儿,比如说装APP,懂点使用ADB命令的知识是非常有益的(利于装x),你可以不碰手机能干老多事儿了,在下文,我们例举了常见的可以在操作手机的ADB指令。
ADB stands for Android Debug Bridge, and it allows you to communicate with your Android device using your computer. For instance, if you wish to install an app on your device right from your desktop, you can do so using ADB. There is a lot more you can do with ADB than just installing an app. Having knowledge of some of the most used ADB commands is really beneficial, as it will let you perform a number of actions on your device without even touching it. Here, we have compiled some of the common commands that you can use with ADB to perform actions on your device.
- Reboot your Device 重启手机
1 | adb reboot |
- Reboot into Recovery 重启进入Recovery模式
1 | adb reboot recovery |
- Reboot into Bootloader Mode 重启进入Bootloader模式
1 | adb reboot bootloader |
这里我想提醒看本文的朋友,如果不懂Bootloader模式是什么就不要进去了,可能会把手机变成 “真.砖”.
Bootloader是嵌入式系统在加电后执行的第一段代码,在它完成CPU和相关硬件的初始化之后,再将操作系统映像或固化的嵌入式应用程序装在到内存中然后跳转到操作系统所在的空间,启动操作系统运行.-来自百度百科的一段介绍
- Reboot into Fastboot 重启进入Fastboot模式
1 | adb reboot fastboot |
- Send File to your Device 给手机发送文件
1 | adb push Source Destination |
上面的命令支持你发送文件到设备上去,你只需要将文件的源路径写在命令的Source参数上和你想发送的目标参数填写完毕。
The above command lets you send files to your device. You just need to specify the source location of the file in the source argument in the command and the destination where you want to send your file.
- Get File from your Device 从手机获取文件
1 | adb pull FileLocation Destination |
此命令支持你从手机拉取数据,换句话说,从手机接收文件。只需要填写设备上的文件路径与电脑上的目录即可正常运行。
It will let you pull, or in other words, receive a file from your device. Just specify the file location on your device and the destination in the command, and it should do the job for you.
- Install an App on your Device 安装APK
1 | adb install APKLocation |
这条命令支持你从电脑安装手机APP,你只需要填写APK的特殊路径,他就会安装你选中的APK.
What this command does is let you install an app on your device right from your computer. You just need to specify the APK location in the command, and it will install the selected app on your device.
- Remount the System 重装系统
1 | adb remount |
如果你想重新挂载你设备的系统分区,可以用上面提到的命令
In case you want to remount the entire system of your device, you can issue the command mentioned above.adb remount
命令主要是 重新挂载系统分区,使系统分区重新可写(读写权限)
Conclusion 结论 略..
These were the most common ADB commands you should know if you have an Android device and you often connect it to your computer. It will save you some time that you will otherwise spend doing tasks manually.
Just having knowledge of some of the commands given above would prove to be really beneficial to you in the future. As if you ever wish to reboot your device into a specific mode or just want to install an app right off your computer, you will be able to do so by just issuing a single line of command from the Command Prompt Window
演示
本文标题:ADB环境配置以及常用命令
文章作者:Keyle
发布时间:2016-12-03
最后更新:2024-08-20
原始链接:https://vrast.cn/posts/e3476f51/
版权声明:©Keyle's Blog. 本站采用署名-非商业性使用-相同方式共享 4.0 国际进行许可