Android Device Monitor/DDMS can't connect to device over network - android-studio

I am trying to debug a memory leak on a Android based VOIP desk phone with Android Studio 2.1 (For what it's worth it's a Grandstream GXV3275 phone, which has a 7in Android tablet embedded in it).
As best I can tell this device has no direct USB connection. I've enabled "Developer Mode" on the phone and am able to connect to it using "adb connect" from the command line. I can use Android Studio to then download and run/debug applications over the network.
But Android Device Monitor will not connect to the device and the phone does not show up in Device Monitor's list of devices. In the Device Monitor's console i see:
[2016-08-30 15:17:32 - DeviceMonitor] Adb connection Error:EOF
[2016-08-30 15:17:32 - DeviceMonitor] Connection attempts: 1
[2016-08-30 15:17:33 - DeviceMonitor] Connection attempts: 2
[2016-08-30 15:17:34 - DeviceMonitor] Connection attempts: 3
Any ideas how to make Device Monitor recognize devices over the network?

Well, the alternative is to use the Android Monitor tab built into Android Studio. This does indeed seem to work without a direct usb tether. Android Monitor supports initiating GC and performing heap dumps (HPROF). The downside that I have seen, is that performing an HPROF dump temporarily disconnects my ethernet connected Android desktop phone from the network.

Related

How to read PC USB ports in Android emulator?

I have a usb device for transmitting data. the device works perfect in windows OS. I am to use the device in Android 13 the Device acts as Human Interface Device.
I am using Android Emulator for programming. It seems the emulator work only for UI and not for external hardware.
And I achived that in android app, It can able to read that pendrive. When I run that app in Emulator it is not detecting.
Can you suggest how can I make Android emulator detect the usb device.
Thank you for your kind interest.
Regards
I want to connect USB device on Emulator.. and need to view that contents.

Connect Android Studio and Wear 3.0 smartwatch via wi-fi

ADB debugging needs connection between Android Studio and Wear 3.0 smartwatch (Samsung Galaxy SW 4). How make them work together?
Switch ON Developer Mode on your Smartwatch, including A) Activation Developer Mode in Settings (in most cases push many times on Settings-> About watch -> Software -> Software Version) B) Set ON ADB Debugging C) Set ON Wi-Fi Debugging
Connect work station with Android Studio and smartwatch wear 3.0 to the same wi-fi network
Connect smartwatch via usb charger with workstation (obligatory in most cases at least once)
Send the command in Terminal - adb connect XXX.YYY.Z.A:5555, where XXX.YYY.Z.A - address of your Wi-fi - find it in settings of wifi in smartwatch or workstation
Accept the request on the smartwatch (always allow / always trust);
Check in Studio the change from No Device to your smartwatch.
Notes:
sometimes it's obligatory to turn on \ off ADB Debugging and Wi-Fi Debugging on smartwatch and try again;
sometimes the connection between smartwatch and Studio is working without USB connection at all (but mostly one time and you need to repeat "adb connect XXX.YYY.Z.A:5555";
sometimes you need smartphone in the same Wi Fi network with workstation and smartwatch, sometimes it works well without smartphone.

Android 6.0 device not recognized by adb on Linux after reboot

In Samsung Galaxy S6 Edge with Android 6.0, when the device is rebooted, phone complains that the connected computer doesn't recognize the phone and the device is not any more reachable over ADB from the connected Linux PC. The phone in fact instructs user to install proper drivers for Windows or Mac OS, but as the phone is connected to Linux host, there is no help here.
This means, that in order to continue debugging over ADB, one must manually toggle the USB mode from phone from MTP to PTP, after which phone is connected through ADB again. This makes test automation impossible, as the test scheduler needs to reboot the target device between test rounds.
With previous Android versions, rebooting the device remotely and getting ADB connection back was possible, but with Android 6.0, this became a problem. This particular device had earlier Android 5.1 and there were no problems with remote reboots.
As manually toggling of USB mode solves the problem, it might help, if this mode could be automatically toggled after reboot. So far, only solutions I have seen require device rooting and that is out of question.
Does someone have any idea, how Android 6.0 device could be automatically recognized by ADB after reboot?
The solution was after all simple: the Linux user, who starts up the adb server, needed to be added to the "plugdev" group. This group was defined in file /etc/udev/rules.d/51-android.rules with line:
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
With previous Android versions, this didn't seem to be important as we didn't have any users in that group and everything worked fine.

Can I use a physical phone for debugging in Android Studio wirelessly?

Debugging apps on a physical device (in my opinion) is better than using an emulator.
I was wondering if it's possible connect my phone to my computer via Bluetooth (or wirelessly) without a USB connection.
The wire kind of get in the way sometimes.

Bluetooth support on Android Emulator

I want to know if the developer team which made the emulator have some information to make bluetooth work in the Android emulator, indicate some links about it, if they have some date for release or if they'll make it works in the future.
as far as I know there is no support in the emulator for bluetooth. And I will have to teach android and bluetooth in some classes. And the students will need to code stuff and test (guess it) in the android emulator.
So I came up with a bare-bone reimplementation of the android bluetooth API on top of tcp. You can find it on here on github.
Basically, you run a tcp-server on your machine, and the emulators will connect through it.
Instead of using the classes in the package android.bluetooth, you just need to use the classes in the package dk.itu.android.bluetooth (and other 2 little modifies).
As for now it supports:
switch on/off the "radio"
discovery devices (only other android emulators)
creating bluetooth services
connecting to bluetooth services
It's not much, but until we got some more from the android guys, I guess there is nothing else around.
Hope it'll be useful, cheers!
The documented bluetooth limitation appears inconsistent with the qemu -bt option. So, how is bluetooth enabled in the emulator so the -bt options can be used, or at least to know that bluetooth is supported?
The target/board/.../BoardConfig.mk having "BOARD_HAVE_BLUETOOTH := true" doesn't provide a bluetooth icon or enable bluetooth. So, how do we turn on bluetooth on the android qemu emulator?
What does it mean that bluetooth is not supported given the -bt option for emulating USB devices that were provided in 2008? The post and limitations are outdated.
The functional limitations of the emulator include:
No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator console, however.
No support for USB connections
No support for device-attached headphones
No support for determining network connected state
No support for determining battery charge level and AC charging state
No support for determining SD card insert/eject
No support for Bluetooth
http://developer.android.com/tools/devices/emulator.html#limitations

Resources