android - 如何让 Android 命令行工具工作?

标签 android macos

我不知道如何让我的 Android 命令行工具工作。我运行了以下命令,但是当我输入 Android avd 时,输出是 bash: android: command not found。有没有人对如何让 Android 命令行工具工作有任何建议?我已经安装了 SDK 等。我不知道该怎么做。

export Android_Home=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools
export PATH=$PATH:$ANDROID_HOME/tools

最佳答案

一个明显的问题:

export Android_Home=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools
export PATH=$PATH:$ANDROID_HOME/tools

...Android_HomeANDROID_HOME 不同。 Mac OS X(和其他 Unix 系统)上的环境变量名称区分大小写。尝试:

export ANDROID_HOME= ...

接下来,OP 在评论中写道:

I can't find .bash_profile

好吧,你只需要在你的主目录下创建它。打开一个终端,然后输入:

nano ~/.bash_profile 

另外,我认为在

export ANDROID_HOME=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools

... /tools 位太多了。 SDK 主页应该只是 /Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/,然后在 PATH 中你想要 $ ANDROID_HOME/tools.

关于android - 如何让 Android 命令行工具工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20180462/

相关文章:

android - 移动编程基础

macos - 从 shell 脚本或命令行写入 Mac OS X 控制台日志

macos - 如何将PDF转换为CGImage,然后保存为高DPI JPG图像?

android - 如何修复 Module 依赖于一个或多个 Android Libraries 但在构建 Cordova App 时是一个 Jar

android - 如何以编程方式在 Android 中打开/关闭通知?

bash - 来源来自 Standard In(OSX 上的 Bash)

objective-c - Cocoa 中的 View 列表

c - 对于非 GNU 链接器,是否有等效于 GNU 链接器 "--just-symbols"选项的选项?

android - android setContentView 中的 2 个不同 View

android - Firebase 与 Android Studio 的连接错误 : Manifest merger failed