Urgent: No target specified and no devices found / Deploy on android


#1

Hi everyone.

I’m lost. I currently finished the app I was tasked to build for my job using Ionic 3. I now want to generate the apps APK and test it on an (the boss’) Android device.
Unfortunately when I try to do ionic cordova run android I get the error message: No target specified and no devices found.
I also tried doing that with --device, similar result.

When I do adb devices it returns an empty list.

I made sure usb debugging is turned on on the phone.

I’m clueless and under increasing time pressure!

Edit:
Additional info:
When I do ionic info I get:


    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.4.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.0.0 
    Node       : v9.4.0
    npm        : 5.6.0 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro


But when I build or run it says ANDROID_HOME=/Users/jan/Library/Android/sdk.

If anyone knows how to help, I would be super thankful!


#2

Did you add android as platfrom at all?


#3

Try unplugging the phone for a few seconds, and plug it in again.
Also, what kind of phone is it?


#4

Yes I did :slight_smile: (If you mean ```ionic cordova platform add android``)


#5

The phone is a Samsung Galaxy S7.

The App works on my iPhone 8 when I use XCode.


#6

Does ionic cordova build android work?


#7

Yes it does work and ends with Built the following apk(s): <name-of-the-apk> .


#8

Then try manual install

Adb install path to apk


#10

adb install <path-to-device>

gives out

adb: error: failed to get feature set: no devices/emulators found
- waiting for device

Which makes sense, since adb devices also returns an empty list. The root problem is that the phone somehow isn’t recognized.

It is on other computers though! A colleague of mine (who is on vacation as of two days ago) was able to run the app on the boss’ phone using ionic cordova run ios


#11

When plugged in, does the phone say “USB debugging connected. Touch to disable USB debugging”? At least that’s what it says when I connect my Galaxy S4.
It might also be the USB cable. I’ve used a cable that didn’t show the message (though the phone was charging), and adb devices didn’t show the device. I used a different cable, and the message showed, and the device showed in adb devices.


#12

Well, its an adb related issue, so I would google on that

Does it fire the emulator if u disconnect the cable? Ionic cordova run android

This to test if adb can install at all?


#13

Btw thanks @Tommertom and @obinnae for your help! You are giving me hope right now!

No it does not say that. The same cable was used by a colleague of mine 2 days ago, so it seems unlikely to me, that it is the cause of the error…


#14

Never think unlikely

Assumptions are the mother of all ##%%***-ups

Test the assumptions


#15

Try deploying the apk from http source

Never done that but i believe that is doable

Or even as attachment in email

Even seen apk distributed through whatsapp


#16

Lol you literral god :smiley: Just ran half way through the office and asked to get a new cable, got one, immediately got the message that the device has just been connected.

Thank you very much!

No (off topic) I got a new error:

Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package de.ordersome.starter signatures do not match the previously installed version; ignoring!]

Will google the shit out of it though :slight_smile:


#17

Good

U r out of credits anyway!

:stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye:

Just kidding. End of the train ride home. Schoenes Wochenende


#18

Thank you, enjoy your weekend too!


#19

Glad to hear. Looks like there’s a version of the app already on the phone that you need to delete. Try running adb uninstall de.ordersome.starter then try again


#20

Did exactly that 5 minutes ago and it works now :slight_smile:


#21

Great! Glad to hear!
Have a good one.