ADB, Wifi and Eclipse: how can I configure?

Recently, I see that you can debug application development using WIFI instead of the USB debugging method. I do a search and I found an application called abdWireless , but I have a problem.

How can I get Eclipse to connect via the Wifi method?

I think this is an automatic process, but when you start debug, it opens the emulator.

Someone? :) Bye

+42
android eclipse wifi adb ddms
May 20 '11 at 8:15
source share
3 answers

First run "adb connect ip: port", for example adb connect <phone-ip-address> , from the console / terminal (with your IP address and reason port). This makes the adb service to connect to your device over the network. Port 5555 is used by default if no port number is specified.

Then check if the device is connected correctly: launch adb devices from the console / terminal (make sure you remove the USB cable from the device). If adb devices does not display your device, you have a completely different problem.




If you connected your device via adb , and you can see the device in the adb devices list, but your eclipse still starts the emulator,

  • Go to Run-> Debug Configuration β†’ [your configuration]
  • In your configuration, go to the Target tab and select Manual

enter image description here

This will be the choice of a pop-up device each time the application is launched from eclipse. This way you can explicitly specify which emulator / device to use.

To disconnect your device, adb disconnect <phone-ip-address>

+65
May 20 '11 at 9:43 a.m.
source share

This process can be automated from Eclipse using Adb Connect: http://ppareit.github.com/AdbConnect/

+10
Sep 18 '11 at 10:28
source share

I will try to explain how I connected eclipse with my Android device using adb thru wifi on my win7 x32 while using my internet connection.

I use two methods. The first is when my computer is connected to the Internet (i.e. via an Ethernet cable), and I share this connection with my Android device via Wi-Fi (as a hot spot). The second one I use when my computer is not connected directly to the Internet, but I use my Internet device to connect my computer to the Internet.

1. The computer is connected to the Internet, an Android device connected to the Internet through my computer.

Please note that for this to work, your wireless card must meet certain requirements, as this will not work with all wireless cards.

Well, first of all, you need to share your internet connection with your computer. To do this, open the cmd command line (with the command line) with administrator rights (click the victory logo, enter cmd, and then press ctrl + shift + enter). To set up a hot spot, enter:

  netsh wlan set hostednetwork mode=allow ssid=Hotspot key=D2D46784ECB32 keyUsage=persistent start hostednetwork 

Change "Hotspot" to what you want your ssid to be called. Change β€œD2D46784ECB32” to what you want your key (WPA2) to be.

Now go to Control Panel \ Network and Internet \ Network Connections. You will probably notice a new β€œadapter” called β€œWireless Network Connection 2”. Right-click on the ethernet connection (or any device that you use to connect to the Internet). Click on properties. Click on sharing. Check the box next to "Allow other network users to connect via an Internet connection to a computer." Select "Wireless Network Connection" 2. Click "OK." What you just did is launch Internet Connection Sharing (ICS).

The next step is to connect your device to the connection you just created. On your Android device, find the Wi-Fi connection that you find using the ssid that you installed (i.e. Hotspot) and enter the key that you established (i.e. D2D46784ECB32). Once the connection is established, you will get access to the Internet.

Please note that sometimes I have problems with this connection. Sometimes my device cannot connect (I think there is an error in win7). Usually I fix this by going to my computer connections, and when I connect via Ethernet, I go to properties β†’ sharing, uncheck the box "Allow more ...". Click OK. Then go to these connection properties β†’ sharing and check the box "Allow others ...". I basically reset ICS. And now I usually can connect.

Also note that after rebooting the computer, most likely you will have to restart the host network and reset ICS.

To stop the access point, enter:

  stop hostednetwork 

To start the hot spot, enter:

  start hostednetwork 

Please note that you do not need to set up the host network again, just start it. Also note that you must be in netsh-wlan mode (enter netsh and then wlan, as before), and cmd must be run as administrator.

Now, if you have not done so already, enable your developer’s settings on your Android device and enable ADB over the network. After that, you will most likely see the ip address added

  :5555 

t .: 192.168.137.158DUC555

On your computer, open cmd, go to the adt / sdk / platform-tools folder. On my computer it is like this:

  cd "C:\Program Files\adt-bundle-windows-x86\sdk\platform-tools" 

And enter the following:

  adb connect 192.168.137.158 

You must replace the ip address with the one shown on your Android device in the developer settings. (I did not need to add the suffix / port 5555, but you may need to do this). To check if the connection was successful, enter:

  adb devices 

(By the way, I would like to thank Inzazaruk for his help in this).

You should now be able to connect eclipse to your Android device via wifi, as others have explained (configure β†’ target β†’ manual).

2. The computer is not connected to the Internet. You are using the Internet connection of your Android device to connect your computer to the Internet.

On your Android device, go to Settings β†’ Advanced β†’ Modem and portable hotspot β†’ Configure wi-fi hotspot. Change the SSID, key and security as you like.

Go back one step and turn on the portable Wi-Fi Hotspot.

On your computer, connect to your Android device via Wi-Fi, as with any other wi-fi connection, with ssid and key installed.

As soon as you connect, go to Control Panel \ Network and Internet \ Network Connections, right-click the wireless connection you just connected to. Select Status, and then Details. Find the IPv4 address of your computer (at least I use IPv4, you can use IPv6).

This address may look like this: 192.124.159.52 The default gateway should be: 192.124.159.1

On your computer, open cmd, go to the adt / sdk / platform-tools folder. On my computer it is like this:

  cd "C:\Program Files\adt-bundle-windows-x86\sdk\platform-tools" 

And enter the following:

  adb connect 192.124.159.1 

You must replace the ip address with the one shown by default by the gateway (I did not need to add the suffix / port 5555, but you may need to do this). To check if the connection was successful, enter:

  adb devices 

(By the way, I would like to thank Inazaruk for this).

You should now be able to connect eclipse to your Android device via wifi, as others have explained (configure β†’ target β†’ manual).

3. The computer and the Android device are connected to the Internet through the same Wi-Fi modem.

I have to admit that I have not tried this option, but I assume that it is similar to the previous ones. Find the IP address of the Android device in the developer settings (you can see it when you turn on ADB via the network). And then on your computer, as before:

open cmd, go to the adt / sdk / platform-tools folder. On my computer it is like this:

  cd "C:\Program Files\adt-bundle-windows-x86\sdk\platform-tools" 

And enter the following:

  adb connect <ip_address_of_your_android_device> 

. To check if the connection was successful, enter:

  adb devices 

You should now be able to connect eclipse to your Android device via wifi, as others have explained (configure β†’ target β†’ manual).




Now I know that this is not quite the answer to the question. But it was very difficult for me to share my Internet connection and then use Wi-Fi with eclipse to develop applications. After some time, I managed to connect, as I described. So, if I helped someone do the same, I would be very happy :-)

+9
Mar 06 '13 at 14:16
source share



All Articles