Sketches just won't run from the IDE

edited October 2013 in Android Mode

When I try to run a sketch on my phone, it builds, takes a long time saying it's 'Waiting for device to become available', then eventually gives up - 'Lost connection with device while launching. Try again'. No sign of the phone noticing what's happening at all, whether it's set to 'Connected as an installer' or 'Media device', or even 'Camera'.

This is in spite of the phone - a Huawei P2-6011 running Android 4.1.2 - having Debugging turned on, and being set to allow apps from 'unknown sources', and indeed running packages that I've previously signed and made .apk files of. The problem presumably isn't in the code, since I can run it just fine on a handy Samsung Galaxy.

I'm running Windows 8 right now, alas. I haven't tried from other OSs with this phone yet.

Any suggestions for things I should try in order to run sketches from the IDE?

Answers

  • Answer ✓

    The phone probably isn't recognized by ADB as a valid device. Getting this set up is generally the hardest part of Android development (in my experience, at least). To test to see if the device is recognized, open Command Prompt and typeadb devices. Ifadbisn't recognized as a command, then that's a whole problem of its own. However, if the device isn't listed, or it's listed as offline, then you have more device driver setup to do.

    I don't have any experience setting up a Huawei phone, but I imagine the process is similar to other devices. When you say that you can run the app on a Samsung Galaxy, does that mean that you were able to install the device drivers properly... or that you didn't have to?

  • Thanks! I don't think I've ever had to install device drivers specially before, at least not in Windows! Maybe it came with 'Google USB Driver' from the SDK Manager. What sort of drivers should I be looking for? The Huawei page for my phone provides nothing promising. :-/

    adb isn't recognised as a command by default, although the Android SDK Manager confirms I have Android SDK Platform-Tools installed, and in fact if I navigate to C:\Program Files (x86)\Android\android-sdk\platform-tools it's there - and when I run '.\adb devices' it gives me an empty 'List of devices attached'.

  • Yeah, you have to set up the driver for the device. I suppose that setting upadbto be recognized globally is the least of your worries and won't matter as long as Processing can find it...

    Perhaps this will be the driver that you need: Huawei Device Driver. I can't be too sure, though - it is Huawei, after all...

  • You must make sure that "Google USB Drivers" is installed from your SDK manager.

    Then if this doesn't help you may want to check out: http://forum.xda-developers.com/showthread.php?t=1830108

    Part entitled Android Composite ADB Interface Driver

    looks like images are gone from the document, but it's still a good description.

    Remember to reboot your computer when you feel it's necessary.

    adb isn't recognised as a command by default

    Also on windows it will NOT be recognized by default, and you have to add C:\Program Files (x86)\Android\android-sdk\platform-tools directory manually to your PATH environment variable.

    Also when you run adb devices on windows you don't have to precede it with "./" (unlike on linux)

  • Ah, thanks! Very plausible. That doesn't seem to have made any difference though, alas. :-/

  • dimkir, Google USB Driver was already installed...

    For what it's worth, in Device Manager, HUAWEI P2-6011 was already listed as having a working driver. There's also 'Android' under 'Other Devices', but when I try feeding it the Google USB Driver it says 'The folder you selected doesn't contain a compatible software driver'...

  • Answer ✓

    If adb devices reports empty list, then you should try to search some android forums on the subject of enabling your phone being visible by the computer.

    Out of my 4 android devices, I had only to do this "driver dance" only for 1. Others were detected automatically.

  • Got it! I ended up following somebody's recommendation to install PdaNet - although it's possible that what really made the difference was just selecting 'Hi-Suite' from the list of USB connection options, whatever that means.

  • Thanx for feedbacking on your progress.

    Never heard of Hi-Suite, but it looks like it's a huawei device management tool

    http://www.huawei.com/minisite/HiSuite_en/

    Maybe when you opt to choose it, it uses correct drivers or smth.

Sign In or Register to comment.