Connect adb shell over Wireless / Wifi / Ethernet / TCP network

NOTE: for below article, replace IP address whereever required with your IP address

If you want to connect your mobile/device over wifi adb and access the shell, by default most of the mobiles will not be able to connect, but if you are actively working with some development platform, it might have adb working properly over network, in both of the scenarios, use below mentioned commands to connect adb over network.

If you are using a android development environment device or a rooted device which allows to do certain experiments, in those adb might be already enabled over network,

1. Check the IP address of the device, for this, make sure you have your device connected to network, then goto Settings -> Network & Internet -> click on connected network interface ( Wifi/Ethernet ) -> Select Again -> This will show the device IP address.

OR you can connect device over USB cable and type,

 $ adb shell 
 $ ifconfig 

Note the IP address and then exit from USB adb and remove USB cable. Now, connect over network using IP address as,

 $ adb connect
connected to 
 $ adb shell 

Sometimes, you may seen an error as below,

$ adb connect
unable to connect to

For this, we need to restart the TCP port using USB adb as, connect device over USB cable and type

 $ adb tcpip 5555
restarting in TCP mode port: 5555

Now, you will be able to connect over network as,

 $ adb connect
connected to 

If you have not removed the USB cable, you might seen the same device as two devices as,

 $ adb devices
List of devices attached
B2NGAA8831702707	device	device
$ adb -s shell
B2N_sprout:/ $ 
Android Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question