android-command_tool-adb

本文深入解析了Android SDK及ADB命令的使用方法,包括如何打开SDK Manager、管理AVD、启动模拟器、使用DDMS调试器、进行设备间文件传输、启用设备shell以及安装、卸载APK等关键操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

android --打开android sdk manager


android list or android list avd --列出所有avd
android avd --打开设备管理器
emulator ** --模拟器相关
emulator -avd d1 --启动名为d1的模拟器


ddms --打开调试器


adb devices --所有设备
adb devices -l


adb push ** --拷文件到设备
adb -s emulator-5554 push ~/desktop/1.png /sdcard/music/download/1.png


adb pull ** --从设备拷文件
adb -s emulator-5554 pull /sdcard/music/download ~/desktop  --指定特定设备
adb -s 4d0089124a365151 pull /sdcard/xx/mv localmv/  --拷贝mv目录下的所有文件到localmv目录下


adb shell --启用设备的shell(只有一个device时成功)
adb -s devicename shell --启用特定的device的shell
adb install ** --安装apk
adb uninstall ** --卸载apk
dx --class转dex
aapt --打包资源
mksdcard --创建虚拟sd卡


# 发现adb异常,可以重启它
adb kill-server
adb start-server
root@hi3798mv300:~# adb version -bash: adb: command not found root@hi3798mv300:~# # 更新软件源 root@hi3798mv300:~# sudo apt update Hit:1 http://repo.huaweicloud.com/ubuntu-ports focal InRelease Hit:2 http://repo.huaweicloud.com/ubuntu-ports focal-updates InRelease Hit:3 http://repo.huaweicloud.com/ubuntu-ports focal-backports InRelease Hit:4 http://repo.huaweicloud.com/ubuntu-ports focal-security InRelease Hit:5 https://repo.huaweicloud.com/docker-ce/linux/ubuntu focal InRelease Hit:6 https://www.ecoo.top/update/repo/arm64 histb InRelease Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. root@hi3798mv300:~# root@hi3798mv300:~# # 安装ADB依赖库 root@hi3798mv300:~# sudo apt install android-tools-adb android-tools-fastboot libusb-1.0-0 Reading package lists... Done Building dependency tree Reading state information... Done libusb-1.0-0 is already the newest version (2:1.0.23-2build1). libusb-1.0-0 set to manually installed. The following additional packages will be installed: adb android-libadb android-libbacktrace android-libbase android-libboringssl android-libcrypto-utils android-libcutils android-libetc1 android-libf2fs-utils android-liblog android-libsparse android-libunwind android-libutils android-libziparchive android-sdk-platform-tools android-sdk-platform-tools-common dmtracedump etc1tool f2fs-tools fastboot fontconfig fonts-liberation graphviz hprof-conv libann0 libcairo2 libcdt5 libcgraph6 libdatrie1 libf2fs-format4 libf2fs5 libgraphite2-3 libgts-0.7-5 libgts-bin libgvc6 libgvpr2 libharfbuzz0b libice6 liblab-gamut1 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpathplan4 libpixman-1-0 libsm6 libthai-data libthai0 libxaw7 libxcb-render0 libxcb-shm0 libxmu6 libxrender1 libxt6 p7zip p7zip-full sqlite3 x11-common Suggested packages: gsfonts graphviz-doc p7zip-rar sqlite3-doc The following NEW packages will be installed: adb android-libadb android-libbacktrace android-libbase android-libboringssl android-libcrypto-utils android-libcutils android-libetc1 android-libf2fs-utils android-liblog android-libsparse android-libunwind android-libutils android-libziparchive android-sdk-platform-tools android-sdk-platform-tools-common android-tools-adb android-tools-fastboot dmtracedump etc1tool f2fs-tools fastboot fontconfig fonts-liberation graphviz hprof-conv libann0 libcairo2 libcdt5 libcgraph6 libdatrie1 libf2fs-format4 libf2fs5 libgraphite2-3 libgts-0.7-5 libgts-bin libgvc6 libgvpr2 libharfbuzz0b libice6 liblab-gamut1 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpathplan4 libpixman-1-0 libsm6 libthai-data libthai0 libxaw7 libxcb-render0 libxcb-shm0 libxmu6 libxrender1 libxt6 p7zip p7zip-full sqlite3 x11-common 0 upgraded, 59 newly installed, 0 to remove and 0 not upgraded. Need to get 8,012 kB of archives. After this operation, 29.5 MB of additional disk space will be used. Do you want to continue? [Y/n] y Abort. root@hi3798mv300:~# adb version -bash: adb: command not found root@hi3798mv300:~# 没有啊 是安装错了吗
06-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值