-bash: android: command not found on Mac OSX

前端 未结 9 1836
陌清茗
陌清茗 2020-12-12 13:38

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 rea

相关标签:
9条回答
  • 2020-12-12 14:33

    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"

    0 讨论(0)
  • 2020-12-12 14:44
    export PATH="/Users/me/Library/Android/sdk/platform-tools/":"/Users/me/Library/Android/sdk/tools/":$PATH
    

    Worked for me

    0 讨论(0)
  • 2020-12-12 14:44

    Update the path.

    Open the Terminal program from Spotlight. Run the following command:

    touch ~/.bash_profile; open ~/.bash_profile
    

    Then save following code

    export PATH=${PATH}:/android-sdk-macosx/platform-tools:/Development/android-sdk-macosx/tools
    

    For my case, path is

    export PATH=/Users/<user-name>/Development/android-sdk-macosx/platform-tools:/Users/<user-name>/Development/android-sdk-macosx/tools:$PATH 
    

    Save the file and quit the text editor. Execute your .bash_profile to update your PATH:

    source ~/.bash_profile
    

    Then run adb.

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