即使设置了 PATH 也找不到 Android 命令 [英] Android command not found even PATH set

查看:25
本文介绍了即使设置了 PATH 也找不到 Android 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我使用的是 ubuntu 12.04.在 ~/.bashrc 文件中我设置了以下内容

hi i am using ubuntu 12.04. and in ~/.bashrc file I set following things

export ANDROID_HOME=/home/nilkash/Downloads/android-sdk-linux/platform-tools

但它仍然给我 android: command not found 错误.如何为android设置路径.需要帮忙.谢谢.

But still it gives me android: command not found error. how to set path for android. Need Help. Thank you.

推荐答案

要将 SDK 的工具和平台工具目录包含在 PATH 环境中,请打开文本编辑器以创建或修改 ~/.bash_profile文件,添加以下行:

To include the SDK's tools and platform-tools directories in your PATH environment open text editor to create or modify the ~/.bash_profile file, adding below line:

export PATH=${PATH}:/home/nilkash/Downloads/android-sdk-linux/platform-tools:/home/nilkash/Downloads/android-sdk-linux/tools

对于 Ubuntu:

要修改系统的 PATH 变量,您需要编辑 .bashrc 文件.为此,请在终端中执行以下命令:

To modify the PATH variable of your system, you need to edit your .bashrc file. To do so, in a terminal, execute the following command:

$ nano ~/.bashrc

您现在将在终端上启用 Nano 文本编辑器.现在,在文件的最顶部,输入以下内容:

You will now have the Nano text editor enabled on the terminal. Now, at the very top of the file, enter the following:

#AndroidDev PATH
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools

完成后,按 CTRL + X、Y,然后按 Enter 保存更改并退出 Nano 文本编辑器.

Once you're finished, press CTRL + X, Y, and then hit Enter to save your changes and exit the Nano text editor.

在不重新登录的情况下重新加载~/.bashrc:

To reload the ~/.bashrc without re log in:

. ~/.bashrc or source ~/.bashrc

参考资料:
- help.ubuntu.com/community/AndroidSDK
- 如何在不注销并重新登录的情况下重新加载 .bashrc?

这篇关于即使设置了 PATH 也找不到 Android 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆