Android - Command not found

前端 未结 9 1877
情书的邮戳
情书的邮戳 2020-12-07 11:37

I am trying to run the command in ubuntu

android update project --path .

However I am getting a android:command not found

相关标签:
9条回答
  • 2020-12-07 12:03

    Another possibility is simply that your "android" file is not executable. Navigate to the tools path in terminal and then make it executable by:
    chmod 777 android
    Then you can run:
    ./android sdk
    It's what worked for me.

    0 讨论(0)
  • 2020-12-07 12:03
    1. Uninstall cask android-platform-tools

      brew cask uninstall android-platform-tools
      
    2. Install it using Android Studio

    0 讨论(0)
  • 2020-12-07 12:06

    That's because your platforms and platform-tools are not in the PATH environment variable. You can run the adb command with path-to-adb/adb or add platforms and platform-tools to PATH and run typing only adb

    This is my path environment variable:

    PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3:/opt/android-sdk-update-manager/tools:/opt/android-sdk-update-manager/platform-tools
    
    0 讨论(0)
  • 2020-12-07 12:12

    android is now inside android-sdks/tools

    if you are using mac, you may set your .bash_profile to include it.

    PATH=$PATH:[android-sdks]/platform-tools:[android-sdks]/tools
    
    0 讨论(0)
  • 2020-12-07 12:14

    Sometimes even after you add your android_sdk/ dir path from command line it still doesn't work and gives the command not found error, in that case follow these steps. I ran through this issue myself and i tried all the above steps and none worked so i thought i should share and perhaps that might help somebody.
    ( android-sdk-linux is the name of android sdk library which you have extracted ).

    1) Open the bashrc file from command line

    gedit ~/.bashrc
    

    2) Add following lines at the top.

    export PATH=${PATH}:~/android-sdk-linux/tools
    export PATH=${PATH}:~/android-sdk-linux/platform-tools
    

    3) Log out of the system and log back in. Type Ctrl + Alt + T to open command line and type android to launch the software.

    0 讨论(0)
  • 2020-12-07 12:22

    After installing Android studio. Create or edit your ~/.bashrc file and add the following lines:

    export ANDROID_HOME=~/Android/Sdk
    export PATH=${PATH}:${ANDROID_HOME}/tools
    

    and reload .bashrc

    source ~/.bashrc
    
    0 讨论(0)
提交回复
热议问题