Following another Ionic tutorial

I am trying following https://www.techiediaries.com/ionic-cordova-sqlite-barcode-scanner-product-inventory-manager/. Seems like everything ran successfully until this command:
ionic run android -l.
I had to run it like this:
ionic cordova run
Here is the result:

cordova run android

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

(node:8156) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: 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.
(node:8156) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[06:34:32] lint finished in 2.27 s

[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?

My question is does “cordova run android” command really start the app on my Android device? also based on results of it why do I have an error? Am I missing some installation?

Thanks

After installing Android Studio, adding more SDKs and accepting licenses I am getting this now:
PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT. Any idea?

What else does this thing want?
C:\Windows\system32>set
ALLUSERSPROFILE=C:\ProgramData
ANDROID_SDK_ROOT=C:\Users\Mark\AppData\Local\Android\Sdk

BUILD SUCCESSFUL in 2s
47 actionable tasks: 1 executed, 46 up-to-date
Built the following apk(s):
D:\product-inventory-manager\platforms\android\app\build\outputs\apk\debug\app-debug.apk

ANDROID_HOME=C:\Users\Mark\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_151
No target specified and no devices found, deploying to emulator
No emulator specified, defaulting to AVD_GalaxyNexus_ToolsForApacheCordova

Waiting for emulator to start…

PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT

After restarting the box:

BUILD SUCCESSFUL in 1s
47 actionable tasks: 1 executed, 46 up-to-date
Built the following apk(s):
D:\product-inventory-manager\platforms\android\app\build\outputs\apk\debug\app-debug.apk

ANDROID_HOME=C:\Users\Mark\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_151
No target specified and no devices found, deploying to emulator
No emulator specified, defaulting to AVD_GalaxyNexus_ToolsForApacheCordova

Waiting for emulator to start…

PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [C:\Users\Mark\AppData\Local\Android\Sdk]!

What do I do now? I have my Galaxy 4 connected.

Try Genymotion?

Try to run a sample project out of studio (not ionic/cordova) and see if the emulator fires up at all and the test app runs on your device

This to see if your studio install is sound

Do you mean Android studio? Does it have to be a new project?

Tried new project. See something like this:
Error:Failed to find Build Tools revision 26.0.2

Consult IDE log for more details (Help | Show Log)
Install Build Tools 26.0.2 and sync project

I clicked on Install, it continued endless downloading and indexing. It finally stopped and in the status bar it says Gradle build finished (is it good?) and nothing else is happening. How do I see that what you are asking me is working?

After Run command I was prompted for Emulator to choose and none was enabled. After going to new device and selecting each and every OS I noticed something about Hyper-V that needs to be disabled. I did, restarted, and downloaded Emulator or something. Now when I run and select it I have Android on the screen. Studio says, waiting for device to come online. Android is totally black. Is downloading something else? Although, it’s been a while … Oh, after 10 min. Android says Android is starting… or Installing Application… Back to Studio error message:
Installation failed with message Failed to finalize session : Unknown failure (Error: Could not access the Package Manager. Is the system running?).
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

Background process: Installing APKs.

I oked uninstall. Running it again. Got black Android, nothing else, although when I started new application I added Setting screen.

Looks like complete horror to me

I guess you need to get android studio working, including the emulator, before trying anything else

Sorry about that!