score:65
First, run 'adb connect ip:port', like adb connect <phone-ip-address>
, from console/terminal (with your IP address and port of cause). This makes adb
service to connect to your device via network.
Port 5555 is used by default if no port number is specified.
Then check that device is correctly connected: run adb devices
from console/terminal (make sure you remove usb cable from device). If adb devices
does not list your device, then you have some entirely different issue.
If you've connected your device via adb
and you can see the device in adb devices
list, but your eclipse still starts emulator,:
- Go to Run->Debug Configuration -> [your configuration]
- In your configuration go to
Target
tab and selectManual
This will popup device selection each time you start the app from eclipse. So you will be able to explicitly state which emulator/device to use.
To disconnect your device, adb disconnect <phone-ip-address>
score:9
I'll try to explain how I connected eclipse with my android device with adb thru wifi on my win7 x32, sharing my internet connection at the same time.
I'm using two methods. The first one is when my computer is connected the internet (ie. thru ethernet cable), and I'm sharing this connection with my android device thru wifi (like a hotspot). The second one I use when my computer isn't connected directly to the internet, yet I'm using my device's internet to connect my computer to the internet.
- Computer connected to the internet, android device connected to the internet thru my computer.
Note that for this to work, your wireless card must meet certain requirements, as this won't work with all wireless cards.
Well first of all, you need to share your internet connection from your computer. To do that open cmd (command prompt) with administrative privileges (press the win logo, type cmd, and then press ctrl+shift+enter). To set up the "hotspot", type:
netsh
wlan
set hostednetwork mode=allow ssid=Hotspot key=D2D46784ECB32 keyUsage=persistent
start hostednetwork
Change "Hotspot" to whatever you want your ssid to be called. Change "D2D46784ECB32" to whatever you want your key (WPA2) to be.
Now, go to Control Panel\Network and Internet\Network Connections. You'll probably notice a new "adapter" called "Wireless Network Connection 2". Right click on the ethernet connection (or whatever device you use to connect to the internet). Click on properties. Click on sharing. Check the "Allow other network users to connect through this computer's Internet connection". Select the Wireless Network Connection 2. Click OK. What you just did was to start Internet Connection Sharing (ICS).
The next step is to connect your device to the connection you've just created. On your Android device, search the wifi connection, which you'll find by the ssid you've set (ie. Hotspot), and enter the key you've set (ie. D2D46784ECB32). Once the connection has been established, you'll have Internet access.
Please note that sometimes I have trouble with this connection. Sometimes my device is unable to connect (I think that there is a bug in win7). I usually fix this by going to my computers connections, and on my ethernet connection I go to properties → sharing, uncheck the "Allow other...". Click OK. Then again go to that connection's properties → sharing and check the "Allow other…". Basically I've reset the ICS. And now I'm usually able to connect.
Please also note that once you've restarted your computer, I'll most probably have to restart the hostednetwork and reset the ICS.
To stop the hotspot, type:
stop hostednetwork
To start the hotspot, type:
start hostednetwork
Note that you don't have to set the hostednetwork again, just start it. Please also note that you must be in the netsh - wlan mode, (type netsh and then wlan, as before), and the cmd must have been started with the administrative privileges.
Now, if you haven't already done it, turn on your developer options in your android device and turn on ADB over network. After that you'll most likely see an ip address, suffixed by
:5555
ie.: 192.168.137.158:5555
On your computer, open cmd, go to your adt/sdk/platform-tools folder. On my computer it's like this:
cd "C:\Program Files\adt-bundle-windows-x86\sdk\platform-tools"
And type the following:
adb connect 192.168.137.158
You should replace the ip address with the one that was shown in your android device in the developer options. (I didn't need to add the :5555 suffix/port, but you may need to do it). To check whether the connection was successful, type:
adb devices
(Btw, i'd like to thank inazaruk for his help with this).
Now, you should be able to connect eclipse with your android device thru wifi, as others have explained (run configuration → target → manual).
- Computer not connected to the internet. You are using the internet connection of your android device to connect the computer to the internet.
On your Android device, go to Settings → More → Tethering and portable hotspot → Set up wi-fi hotspot. Change the SSID, the key and the security as you please.
Go back one step and turn on Portable Wi-fi Hotspot.
On your computer, connect to your android device via wifi as you'd do with any other wi-fi connection, with the ssid and key that you've set.
Once you've connected, go to Control Panel\Network and Internet\Network Connections, right-click on the wireless connection you've just connected to. Select Status and then Details. Find the IPv4 address of your computer (at least I'm using IPv4, you might use IPv6).
That address might be like this: 192.124.159.52 The default gateway should then be like this: 192.124.159.1
On your computer, open cmd, go to your adt/sdk/platform-tools folder. On my computer it's like this:
cd "C:\Program Files\adt-bundle-windows-x86\sdk\platform-tools"
And type the following:
adb connect 192.124.159.1
You should replace the ip address with the one that was shown default gateway (I didn't need to add the :5555 suffix/port, but you may need to do it). To check whether the connection was successful, type:
adb devices
(Btw, i'd like to thank inazaruk again for this).
Now, you should be able to connect eclipse with your android device thru wifi, as others have explained (run configuration → target → manual).
- Computer and android device connected to the internet via the same wifi modem.
I must admit that I haven't tried this option, but I'm guessing that it's similar as the two methods before. Find the IP address of the android device in the developer options (you should be able to see it when you enable ADB over network). And then on your computer, as before:
open cmd, go to your adt/sdk/platform-tools folder. On my computer it's like this:
cd "C:\Program Files\adt-bundle-windows-x86\sdk\platform-tools"
And type the following:
adb connect <ip_address_of_your_android_device>
. To check whether the connection was successful, type:
adb devices
Now, you should be able to connect eclipse with your android device thru wifi, as others have explained (run configuration → target → manual).
Now, I know that this isn't exactly the answer to the question. But I did find it very hard to share my internet connection, and then to use the wifi with eclipse to develop apps. After some time, I managed to connect like I've described. So, if I've helped someone to do the same, I'd be very happy :-)
score:10
This process can be automated from within Eclipse with Adb Connect: http://ppareit.github.com/AdbConnect/
Source: stackoverflow.com
Related Query
- Eclipse Java Cucumber debug - how can I configure and run debug in cucumber maven project?
- How to configure Eclipse so it can handle a large amount of projects and code?
- How can I configure and use auto-complete and other Eclipse features within a Maven-managed project?
- What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't?
- How do I configure the proxy settings so that Eclipse can download new plugins?
- ADB, Wifi and Eclipse: how I can configure?
- Why is Eclipse trying to copy my .svn folders from src to bin, and how can I make it stop?
- How Can I Add the Apache POI Library in and Eclipse Project?
- How can I import NetBeans project to Eclipse and vise versa?
- How can I properly configure my Eclipse Luna dark theme?
- How Can I Tell Eclipse to Compile and Build a Project with a Different JRE Version than it Normally Does?
- How can I configure Eclipse to run an external builder or shell command?
- How can I use eclipse to build a GUI? (I want to use only swing/awt and no other packages)
- How can I download Java Servlet documentation and attach with eclipse
- How can I configure Eclipse, GCC, and OpenOCD to work with the STM32F4Discovery board?
- How can I get Eclipse work with Maven and SVN correctly?
- How can use mingw-w64 and MSYS2 with any IDE like eclipse or codeblocks?
- How can I connect to a SFTP server using the "Remote System Explorer End-User Runtime" Eclipse plugin and a .pem private key?
- How do I configure the proxy settings so eclipse indigo can install new plugins
- How can I get java and neo4j to work in eclipse
- How do you add a PHP framework to code completion/assist in Eclipse PDT and can the framework be added as default for all projects?
- How can I scroll left and right in Eclipse editor with the keyboard without moving the cursor?
- How can I install Eclipse and Java SDK on Ubuntu?
- How can I use ansible to script eclipse installation and configuration?
- How can I convince Eclipse CDT that a macro is defined for source code editing and code completion?
- How can I create a Java EE 7 application using eclipse and gradle?
- How (if possible) can I configure Eclipse with Intellij IDEA keyboard shortcuts?
- How can one disable the XML editor in Eclipse for .xsd and related files?
- How can i share an eclipse project files between linux and windows?
- In Eclipse How Can I Edit With One Format And Commit With Another
More Query from same tag
- Write java resource in src directory
- Exclude a project from workspace clearing done by SWTBot
- What best way to CONSTANTLY disable specific lines in logcat in Eclipse?
- database access plugin for eclipse
- How to download sources and javadoc artifacts with Maven Eclipse plugin from other repository?
- NullPointerException when creating a NatTable object in an Eclipse RCP part
- The type ArrayGSackIterable<T> must implement the inherited abstract method GSackIterableADT<T>.remove()
- Unsupported major.minor version 52.0 + Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead
- How do I turn on HTTPS on Tomcat running in Eclipse? (or: How do I edit the server.xml file Eclipse is using when it runs Tomcat?)
- if(x!=y) vs if(x==y)
- Get a CompilationUnit from IBinding
- Adding "open file" button to eclipse toolbar
- How to view existing projects in newer version of the Eclipse on another computer?
- Subclipse - ckeckout directory to existing project
- No module named PIL error in eclipse
- svn update <directory> -r HEAD --force Still leaves dirty copies of local files
- Java build Path error - (library) in (project) cannot be read or is not a valid zip file in Eclipse
- Maven test - java.lang.ClassNotFoundException: org.testng.AssertJUnit
- Error in JavaFX FXML tutorial
- executing jar file created from maven build
- How should I write TestNG test cases so that they can be run one after another (sequentially)?
- How to make the JAVA interface being "implements" by other class after exporting as JAR?
- Session.get in hibernate working while step by step debugging but not while running in eclipse
- Android-NDK Project Eclipse build error
- Set android background to a specific location
- Eclipse Switch focus to console on Run
- Why can the Oracle Java compiler not infer the bounds here but Eclipse can?
- Building multiple runnable jars in maven eclipse
- com.sun.jdi.InvocationException occurred invoking method toString when using switch-case inside it
- Setting AWS region programmatically for SQS