You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/01 19:16:50 UTC

[GitHub] [cordova-android] breautek commented on issue #723: Android emulator not worked

breautek commented on issue #723: Android emulator not  worked
URL: https://github.com/apache/cordova-android/issues/723#issuecomment-488385135
 
 
   The path of `/usr/lib/android-sdk`
   
   should be a directory of several directories, more importantly it should have build-tools, platforms, tools, and platform-tools. See below 
   
   ```
   $ ls
   build-tools  extras    ndk-bundle  platforms       sources        tools
   emulator     licenses  patcher     platform-tools  system-images
   ```
   If `/usr/lib/android-sdk` doesn't look anything like above, then you may have the wrong directory!
   
   Note that some of the command line tools are in these sub-directories. To address that, I have the following inside my .bashrc. While `ANDROID_HOME` should be the only thing that is required for cordova, the other paths may be helpful to debug the android sdk installation.
   
   ```bash
   # ANDROID_HOME should be a directory that looks above
   export ANDROID_HOME="/usr/lib/android-sdk"
   
   # ANDROID_HOME is deprecated and being replaced by ANDROID_SDK_ROOT, but many tools
   # still relies on ANDROID_HOME
   export ANDROID_SDK_ROOT=$ANDROID_HOME
   
   export PATH="$PATH:$ANDROID_HOME/tools" # Required for the android binary
   # export PATH="$PATH:$ANDROID_HOME/tools/bin" # Some android installations have their binaries located in tools/bin instead of tools/
   
   export PATH="$PATH:$ANDROID_HOME/platform-tools" # Required for using adb (Android debug bridge) from command line
   
   # This should be set to the installed build-tools installation, which may be different. 
   # Look inside the build-tools folder to see which build tools versions you have installed, and 
   # use one of them.
   # Required for accessing build and deployment tools such as zipalign
   export PATH="$PATH:$ANDROID_HOME/build-tools/28.0.3"
   ```
   
   Of course after modifying the .bashrc you'll need to restart the terminal for the changes to take effect.
   
   After you restart your terminal if you run `avdmanager --help` then you should see:
   
   ```
   Usage:
         avdmanager [global options] [action] [action options]
         Global options:
     -s --silent     : Silent mode, shows errors only.
     -v --verbose    : Verbose mode, shows errors, warnings and all messages.
        --clear-cache: Clear the SDK Manager repository manifest cache.
     -h --help       : Help on a specific command.
   
   Valid actions are composed of a verb and an optional direct object:
   -   list              : Lists existing targets or virtual devices.
   -   list avd          : Lists existing Android Virtual Devices.
   -   list target       : Lists existing targets.
   -   list device       : Lists existing devices.
   - create avd          : Creates a new Android Virtual Device.
   -   move avd          : Moves or renames an Android Virtual Device.
   - delete avd          : Deletes an Android Virtual Device.
   ```
   
   Then it looks like your environment is configured properly and you can try running cordova again. Hope this helps.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org