如何在Mac中添加Android路径 [英] how to add Android Path in mac

查看:36
本文介绍了如何在Mac中添加Android路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ionic2,并且想在Mac中运行android:使用Command:

I'm using Ionic2 and I want to run android in mac: when I used Command:

ionic cordova run android

我遇到了这个错误:

ERROR running one or more of the platforms: Android SDK not found. Make 
sure that it is installed. If it is not at the default location, set 
the ANDROID_HOME environment variable.
You may not have the required environment or OS to run this project

尽管我在该位置安装了SDK:

although I have SDK installed in that location:

/Users/macbookpro/Library/Android/sdk

当我在终端中编写此命令时:

and when I write this command in terminal:

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

然后写:

sudo nano /etc/paths

我只有这些路径:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

我该怎么做才能正确添加路径!

what should I do to add path correctly!

推荐答案

我遇到了类似的问题,并添加了目录/etc/paths.d

I had a similar problem and I added the directory /etc/paths.d

sudo mkdir /etc/paths.d

并创建一个文件 android-sdk

sudo vi /etc/paths.d/android-sdk

在文件中添加路径并保存

Add your paths in the file and save

这篇关于如何在Mac中添加Android路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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