android: command not found in new terminal window

后端 未结 3 1618
陌清茗
陌清茗 2021-01-26 04:55

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:

$ and         


        
相关标签:
3条回答
  • 2021-01-26 05:12

    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).

    0 讨论(0)
  • 2021-01-26 05:16

    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.

    0 讨论(0)
  • 2021-01-26 05:30

    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.

    0 讨论(0)
提交回复
热议问题