Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
863 views
in Technique[技术] by (71.8m points)

macos - -bash: android: command not found on Mac OSX

I've been diving into Android development for a while, and now I want to use some project (helpshift) in my app. On the website they have some example apps in which the readme says: Run the following inside the /HelpshiftDemo folder.

android update project -t android-17 -p .

So I do this, but unfortunately this gives me an error saying -bash: android: command not found. I understand this, because "android" as such doesn't refer to anything on my laptop (Mac OSX). So I thought it is maybe referring to the adb. So I tried replacing android for the direct path to my adb:

/Users/kramer65/dev/adt-bundle-mac-x86_64-20130917/sdk/platform-tools/adb update project -t android-17 -p .

This gives me a humongous output with more information on adb, which is I guess not the expected result.

So my questions; what does android refer to, and how can I fix this on Mac OSX?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The android tool is located in the tools directory in your SDK. You need to add this to your PATH environment variable so that bash can recognize it.

You can do this by adding it to your PATH in your .bash_profile file. This file should be located in your home directory. Create if it doesn't exist using vi .bash_profile and add the following line to it:

export PATH=<path_to_android_sdk>/platform-tools:<path_to_android_sdk>/tools:$PATH

where <path_to_android_sdk> is to be replaced with the path to your SDK. For example: "/Users/me/android-sdk-mac_86/platform-tools"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...