Instal app in real device

Instal app in real device

by Javier Tejera -
Number of replies: 2

Hi there,

I followed the instructions to compile the app using IOT in Android. Now I have all the files in www.

I want to install it in a real device, and I am not sure if I am doing it correctly. I connected my Android phone and run npx cordova run android. However, I have this error:

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


Any idea?

Otherwise, having an apk file from the www would be enough I suppose?

Average of ratings: -
In reply to Javier Tejera

Re: Instal app in real device

by Noel De Martin -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hi there,

It seems like you don't have the Android SDK installed properly. If you haven't, I suggest that you install Android Studio, that should also install the SDK and you can open the folder in platforms/android to see more details about building for Android.

The command you mention should work, but I suggest that you use npm run dev:android or npm run prod:android instead, because they also call some ionic commands that may be important.

In reply to Noel De Martin

Re: Instal app in real device

by Javier Tejera -
Hi Noel,

It seems that now I can go further, but I still have this error:

Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

It's a pity because it works perfectly fine in my local machine, but after compiling it and try to run npx cordova run android or npm run dev:android or npm run prod:android I have that error. I can't figure out how to build the apk file.

Will try to start from scratch again?