Android device disconnect from adb when launching app from eclipse - java

I have a OnePlus X device, which I use with Eclipse for debugging my apps. I had a Nexus 4 which worked perfectly.
I have a late-2012 macbook pro, and I tried to plug my device directly in the usb port of the computer, and with an external alimented hub.
When I plug my OnePlus and I use the command "adb devices" I can see my device. Troubles comes when I run the Android app from eclipse... At this point, my device is disconnected and the app is not launched. And I can't see my device anymore with adb device. All I can do is restarting the adb server, but it will still disconnect after I tried to run the app in Eclipse
I tried different cables, different usb in, but nothing change.
Anyone has a solution ?

Related

Run android emulator or sandbox on mobile itself

Is there any tool out which runs an apk on a real mobile device, like an emulator. The tool would need to execute the apk properly, but also be able to intercept certain commands. Any chance?
To make it more clear, I dont need a shell command to start and stop or so. I need more of a container emulator like tool, which might be able to inject/alter running compiled code.
The ADB connects to running devices, those are:
Running emulators;
Devices connected trough USB that have "Developer options on"+"USB debugging" on device enabled
Also, you need to accept in the device the key for debugging trough ADB after connecting.
Obs: Drivers may be necessary for the device, (google has a package in SDK manager with Google Drivers that works for some devices too)

Cordova Android Development: Looking for OTG cable options for debugging with peripherals connected

I'm developing a Cordova Plugin for Android that interacts with a printer connected to my Android device's USB port. I also have Ionic in the mix running a working Anular application. I have the Plugin working, but getting to that point was painful. There were many iterations of deploying the app from my laptop (using ionic run Android) swapping the otg cable out and pluging in the printer and testing.
I'm looking for a better develop/debug story. I'm planning to add additional features to the Cordova plugin and would like to find a cable configuration that lets me keep the Android device connected to my laptop while the printer is also connected the Android device.
I've tried a few different after market cables, but everything seem to only support charging the device while connected to the peripheral devices. Nothing seems to allow me to stay connected to the laptop and have a peripheral connected simultaneously.
Is anyone aware of a USB Hub, Switch or Router that could help ease my pain, or have suggestions on how I can easily debug my Java based plugin while it is connected to the USB printer. At a minimum I'd like to be able to attach a debugger to my plugin and step through the Java code.
Using an Emulator is out of the question because the performance is simply unbearable.
Sorry in advance if this question is not appropriate here.
I think I have a better solution for you, you can deploy to your device using adb over Wi-fi and keep your printer cable connected to test your app, here is how:
Connect your android device to your computer using a USB cable
From a command line run adb tcpip 1234 // or any port of your chosing
disconnect your android USB cable
run adb connect <your-phone-ip>:1234
Connect your printer using the USB cable
run ionic run android to deploy your app.
I just tested this combo with a Mac and an Android Nexus 5 and it works like a charm.

Android studio devices

Once or twice a day Android Studio doesn't recognize any devices attached to my computer. Even
adb devices
doesn't show anything. The only thing that makes my devices reappear is restarting my computer. Even
adb kill-server
adb start-server
doesn't show any devices. Does anybody know why and how I can make adb recognise my devices without restarting my computer?
Something strange with my USB port I reckon. Reinserting the cable mostly fixes the problem.
check lsusb , if your cable or usb port have problem your device does not appear
otherwise if you see your device in list and your adb devices is empty, maybe the problem is adb files config, check your VENDOR ID in adb_usb.ini , the VENDOR ID must be same as lsusb id

HTC one V is Not Connecting Via Debugger mode

I am trying to connect "HTC one V" with my Eclipse for Android Application Testing.. I followed following steps to connect my phone.
Installed Google USB Driver Package..
From Phone Settings Debugger Mode is on in Developer Options..
But still when i try to run application in Eclipse it runs in Emulator Not in HTC device.
I deleted all Emulators but still my device is not present in connected Devices.
what should i have to do now?
Here are some tips:
Enable usb-debugging.
Instal HTC phone drivers from their website.
The next step is very important: Exit HTC sync on your pc.

Linux Development/Deployment for Samsung Galaxy S3

I'm using a Linux system (Xubuntu) to develop an Android app. I am using Eclipse to develop this app. I would like to be able to test on my Samsung Galaxy S3, but Eclipse cannot seem to find my device. There is nothing listed under the "Choose a running Android device" section.
I searched Samsung's website for USB drivers to the Galaxy S3, but I found none for Linux - only Windows and Mac. Where's the love for us Linux users? It seems absurd that there would be no USB driver for a Linux system to communicate with a Linux-based device. Is there a driver that I can use?
Did you try
adb kill-server
adb start-server
It is required to do the above in Linux. And also you should be logged in as root user,
https://stackoverflow.com/a/3129903/603744
Or if by any chance you haven't seen this question ,
Samsung Galaxy 7" (GT-P6210) not detecting for USB debugging?
You do not need usb driver for linux, Follow instruction from here. You need to add a file to rules.d
USB Drivers aren't required for Linux, which is why you can't find them.
To be able to deploy your application to your S3, you need to enable USB Debugging mode.
Home Screen -> Apps -> Settings -> Choose Developer options -> USB debugging
Home Screen -> Apps -> Settings -> Security -> Disable debug mode (turn this off)
Now connect your phone, and then run this command:
adb devices
It should list your device. Also, your Android notification area should show that debugging mode is enabled.
You'll now be able to deploy applications to it.
I also work on Ubuntu. You will have to set the USB Vendor IDs. Take a look on this link

Categories