Ionic launch android won't launch app on device

I am new to ionic and am trying to run a sample ionic app on my phone ( Samsung Galaxy s4 ) but I can't seem to get it done. I already have "USB Debugging"

on "USB Debugging"

the developer options.

As seen above, although my phone is plugged in, it runs on an emulator. The application works on the emulator without problems

When i do

$ionic run android

      

The logs say:

No target specified and deploying to emulator

      

The emulator starts up and has no problem launching the application.

Then I tried

$adb devices -l

      

This shows mine device XXX

listed there

I'm trying to run now

$ionic run --devices

      

It says: Unknown platform: XXX

I did my best

$ionic run -d 'XXX'

      

Gives an error message

CordovaError: Unknown platform : XXX at cli .....

      

I even tried to define the launch config file specifying the target, but the results were similar. throws error at q.js throw e;

Target 'XXX' not found, unable to run project.

      

Can anyone please advise which step I have missed?

+4


source to share


3 answers


Hello first check android-manifest.xml file of target android version if it is 22 means you need to download android sdk from 22.0 than your problem will solve



0


source


To run in andorid device write the command:

$ ionic cordova emulate android

$ ionic run android --target=<device_id>

      

where device_id is the code obtained from



$ adb device

s

Link

Hope this helps you

0


source


First make sure you have installed Cordova, the latest at the time of this writing is 8.0.0
$ cordova -v

After installation, plug in your device, enable debugging in developer options, if it first requests to approve the RSA key, confirm or confirm it.
then run the command
$ ionic cordova run android --device

make sure you set path relative to Android Studio in Environment Variables.

with the following command you can clear the cache
$ npm cache clean --f

0


source







All Articles