Usb tether and debug at the same time
Asked Answered
E

10

14

I need network connection on my Android device to test apps. My notebook WiFi adapter is broken, so after 2 hours I've set connection via USB. But! Eclipse doesn't see the device when I start "Wired Tether" on it to get connection and I can't debug my apps.

Does anybody know how to solve this issue? Use USB tethering to get internet connection on phone and debug apps at the same time?

Exhibit answered 31/5, 2012 at 10:28 Comment(1)
What exactly do you mean? Do you want internet connection on your netbook, via your phone? Or internet connection on your phone, via your netbook. Answers to both of these cases are below.Moller
H
9

I don't know of a way to simultaneously use USB debugging and tethering. Here are some workarounds, though:

I know these solutions involve some cost, effort, or inconvenience, but hopefully one will work for you.

EDIT:

As noted in answers from @shkschneider and @CodeShane, Internet sharing via Bluetooth is possible. CodeShane's answer mentions PdaNet (which apparently also allows for simultaneous USB tethering and debugging), and includes a link. Another solution is OpenGarden. These solutions provide access to the Internet for the computer via the phone. If the reverse is desired (and this is not entirely clear from the question), reverse tethering seems to be the answer (see the answer from @NickL).

Hydroxyl answered 28/10, 2012 at 0:53 Comment(0)
H
3

Long story short: you can't. Android simply does not supports it (that is more because of the USB standard and tethering action than AOSP's fault).


So to go around the problem, you should either:

  1. Get internet form another source

    Maybe you could have ethernet connection?

  2. Tether internet from your phone to your netbook in another way

    You can't use wireless tether since your wifi adapter is broken, but maybe you could tether using bluetooth?

  3. Debug your phone in another way

    Maybe you could use an android application like aLogCat or similar?


But in the hand, sorry, you can't tether usb from phone to netbook while usb debugging from the netbook. Your success will depend on your ability to find an alternative solution.

Heterolysis answered 30/10, 2012 at 16:11 Comment(6)
Short story it bit longer: You can, see my answer.Moller
@Moller your answer does not propose how to tether and debug from netbook (read the question: his wifi adapter is broken)Heterolysis
Hmm the first sentence confuses me then. He needs connection on his phone, which means he does not currently have connection on his phone. So tethering your PC with your phone to get connection on your pc, will not work since he does not have connection on his phone? I asumed: PC connects to internet with ethernet, he needs connection on phone -> reverse tether with PC so phone has connection. The wifi part could be: wifi tethering not possible, so HAS to be USB or bleutooth.Moller
@Moller you're right it is confused. Depending on what he meant, yours or mine is best I think.Heterolysis
"Use USB tethering to get internet connection on phone" sounds like reverse tethering to me.. could OP be a bit more clear?Moller
Also, note that the OP and the person offering the bounty are 2 different people, and that the original question goes back to May, so who knows what's really needed at this point! I assumed that the phone was providing Internet access to the computer, but I agree that some of the content in the question definitely suggests the reverse.Hydroxyl
F
2

I would like to point out that I am using PDANet for USB-tethered internet to type this reply while I am also debugging an android application on the same phone via Eclipse Juno. Not sure which side fixed this, but it is awesome!

As for why Eclipse isn't seeing your device, standard troubleshooting tips apply .. make sure to enable USB debugging and unknown sources/3rd party apps, try restarting, check usb drivers, update drivers/eclipse..

Fringe answered 2/11, 2012 at 13:51 Comment(1)
It works. After installing the app I can use simultaneously usb tethering and usb debugging with the native enabling options of android. I didn't need to use the app options to enable tethering, actually I I have logged out the desktop app and still works.Khalkha
W
1

You can use bluetooth tethering to get internet connection and debug using USB.

Whitby answered 1/11, 2012 at 10:28 Comment(0)
M
1

Step 1. Turn off USB tethering Step 2. Turn on Wireless USB Debugging

  • Connect to your device via USB
  • Enter "adb tcpip 5555"
  • Unplug your device
  • Look up your device's IP in the system settings
  • Enter "adb connect [ip address]:5555"

Step 3. Turn on USB tethering

Now you can use internet via USB cable and debug app in wireless mode That's it!

Madelynmademoiselle answered 3/9, 2020 at 7:16 Comment(0)
P
0

Yes, its possible. There's a hack available at below links !

Source: HowToGeek , StackOverFlow

Pulchi answered 1/11, 2012 at 13:19 Comment(1)
What for? His wifi adapter is brokenHeterolysis
M
0

If I understand your question correctly, you want to tether your phone to the PC via USB, and use the (internet)connection of your PC + still get logcat output?

Then yes, this certainly is possible.Tethering is when your PC uses the internet of your phone, the other way around is called reverse tethering. Your device has to be rooted, then you can use this application for reverse tethering.

When you connect your phone to the computer via USB, you press 'connect' in the application. It then installs an app on your phone, which handles the reverse tethering connection. It works, I sometimes have to press 'check DNS' while it is connecting to make it working.. but it works! Also debugging via USB works the usual way.

Moller answered 2/11, 2012 at 7:37 Comment(1)
His notebook WiFi adapter is broken. So reverse tethering is not what is asked here.Heterolysis
M
0

You can actually connect the adb to the phone via TCP. You may need a rooted phone for this to work, though

Myrmecology answered 2/11, 2012 at 15:38 Comment(0)
M
0
  • First you need to debug your device using USB cable then type adb tcpip 5555 it will allow debugging via TCP/IP protocol.

  • After that turn on your USB tethering, now your computer get internet connection but lost the USB debugging.

  • Now you must know your phone IP address so you can debug via TCP/IP. You can use command arp -a in terminal and look at the gateway address.

  • The last is connect to your phone using adb connect yourphoneip:5555 for example adb connect 192.168.42.129:5555

Now you get debug and tether at the same time

Mills answered 11/1, 2021 at 15:47 Comment(0)
F
-2

You can use

  1. WiFi Tethering - For Internet connection
  2. Connect USB for adb.
Floro answered 3/6, 2015 at 14:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.