mac下Android Studio 安装和使用adb

一、adb的安装

1.创建.bash_profile文件

touch .bash_profile

2.打开.bash_profile文件

open -e .bash_profile

3.在.bash_profile文件添加SDK路径

SDK路径查看 Tools -> SDK Manager)

export ANDROID_HOME=/Users/djl/Library/Android/sdk

export PATH=${PATH}:${ANDROID_HOME}/tools

export PATH=${PATH}:${ANDROID_HOME}/platform-tools

4.执行命令

source .bash_profile

5.验证是否安装成功

adb version
djl@djldeMacBook-Pro ~ % adb version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as /Users/djl/Library/Android/sdk/platform-tools/adb

 

二、使用基本命令(abc.apk为事例,abc修改为你的项目包名)

1、安装apk

adb install abc.apk

2、卸载apk

adb uninstall abc.apk

3、覆盖安装

abd install -r abc.apk

4、卸载且想保留数据

abd uninstall -k abc.apk

 

posted @ 2023-02-28 11:23  听着music睡  阅读(736)  评论(0编辑  收藏  举报