0

There is a strange problem for me after i installed the android environment and put the paths like here in this question link

I write the command:

$ android 

The Android SDK manage opens successfully but when i open a new terminal tab and try to write the same command

$ android 

It returns android: command not found

How can i solve this problem ?

Thanks

3 Answers 3

1

The Android SDK manage opens successfully but when i open a new terminal tab and try to write the same command

This is your issue. Your new instance of terminal won't have the path variable set the same.

In your home directory, there should be a file named something like .bash_profile or .profile. Here we will want to either adjust the line that is alreadying exporting the path and append to it (:/path/to/android), or create a new line that does the following:

export PATH=$PATH:/path/to/android 

Now every time you launch a new instance of terminal, that line will be automatically run, and you will have android on your path.

Sign up to request clarification or add additional context in comments.

1 Comment

I add it in the .bashrc file and restart terminal, It works fine. Thanks
1

Its happen sometimes when You have not set the path or Android_Home variable. But What trick I always do is this. I navigate to the sdk folder then in platform-tools then I right press Shift key and right click of mouse and navigate to the option Open command line here.

Now here you can write every command and will do your work. Hopes this will work for you.

Comments

1

After adding the PATH entry to your ~/.profile file as mentioned above, log out and back in. That way your entire session will have android in the path.

I would also add platform-tools to your PATH as well. That give you adb.

So, add something like this to your ~/.profile:

export PATH=$PATH:path_to_sdk/tools:path_to_sdk/platform-tools 

Where you replace "path_to_sdk" in the example with the directory were you extracted the Android SDK (e.g. /usr/local/android-sdk-linux).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.