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

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!

Did you add android as platfrom at all?

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

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

The phone is a Samsung Galaxy S7.

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

Does ionic cordova build android work?

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

Then try manual install

Adb install path to apk

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

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.

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?

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…

Never think unlikely

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

Test the assumptions

1 Like

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

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:

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

Thank you, enjoy your weekend too!

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

1 Like

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

Great! Glad to hear!
Have a good one.