Explorando la herramienta me encuentro con el siguiente error:

$ ionic emulate android

add to body class: platform-android

Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.

Se establece la variable ANDROID_HOME en este caso a mi directorio de instalación del sdk de android para linux:

$ export ANDROID_HOME="$HOME/bin/android-sdk-linux"

Al configurar esto aparece otro error:

$  

You have been opted out of telemetry. To change this, run: cordova telemetry on.

Running command: /home/jorge2/workspace/visor-rutas-ionic/hooks/after_prepare/010_add_platform_class.js /home/jorge2/workspace/visor-rutas-ionic


add to body class: platform-android

Error: Failed to run "javac -version", make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
Your JAVA_HOME is invalid: /usr/lib64/jvm/java

Al hacer un ls a la ruta /usr/lib64/jvm/java se encuentra que no existe, y el comando javac tampoco, así que se procede a generar un enlace simbólico a la versión 1.8 de Java:

$ sudo ln -s /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/ /usr/lib64/jvm/java

$ sudo ln -s /usr/bin/java /usr/bin/javac

Esta vez avanza más la ejecución del comando, sin embargo no encuentra las herramientas adecuadas:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> failed to find target with hash string 'android-23' in: /home/jorge2/bin/android-sdk-linux

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


BUILD FAILED

Total time: 3 mins 0.485 secs

Error: /home/jorge2/workspace/visor-rutas-ionic/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> failed to find target with hash string 'android-23' in: /home/jorge2/bin/android-sdk-linux

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Please install Android target: "android-23".

Hint: Open the SDK manager by running: /home/jorge2/bin/android-sdk-linux/tools/android
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)

Esto se soluciona con:

$ export PATH=$PATH:$JAVA_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Sin embargo sale un error que no encuentra tool.jar, así que se instala la versión devel que provee esta biblioteca:

$ zypper in java-1_8_0-openjdk-devel

Luego nos pide una máquina con lo cual:

Selecciona la versión de android a usar e instala

$ android sdk

Crea una máquina virtual

$ android avd

Las entradas  que fueron de utilidad:

http://geheimerschatz.altervista.org/Wordpress/programmazione/generale/problems-with-phonegap-or-cortana/

http://stackoverflow.com/questions/19722058/where-to-get-the-tools-jar-to-use-with-the-java-8-jdk-early-release

Grupo GNU/Linux Universidad Distrital