Sometimes we need to develop an android application without usb cable. For example, when a hardware keyboard is connected to our android device.
Luckily, you can use ADB over Wifi. I will show you how to do it.
Setting up to connect over wifi
First, you have to connect adb using USB cable.
You have to restart the adb server listening on TCP by typing adb tcpip [port number]
.
The port number is 5555 by default. Of course, you can change it.
adb tcpip 5555
And then, you need to know the IP address of the device connected to Wifi.
you can get the IP address by the ifconfig
command in adb shell.
ifdreamlteks:/ $ ifconfig
......
wlan0 Link encap:UNSPEC
inet addr:192.168.0.11 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::968b:c1ff:fe2c:8242/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:523143 errors:0 dropped:0 overruns:0 frame:0
TX packets:297970 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:677517008 TX bytes:54013350
Everything is ready. Let's connect to adb over Wifi. Remove the USB cable and enter the following command to connect to adb over Wifi.
// adb connect [ip address]:[port number]
adb connect 192.168.0.11:5555
Note that Your computer and the device have to be connected to the same Wifi.
Related Posts
- How to download and build Android 13, AOSP
- Notification permission request, pop up notification in Android 13
- Resolve `Access blocked: ComponentInfo` error on Android 13
- Fix error "android gradle plugin requires java 11 to run. you are currently using java 1.8."
- Android - Vibration, Vibrator, VibrationEffect example
- How to get phone number in Android
- How to create Bugreports and Logcat with ADB in Android
- Clear application user data with ADB in Android
- How to disable/enable apps with ADB in Android
- How to find PID of a package with adb in Android
- How to grant/revoke permissions with adb in Android
- How to install an apk(app) with adb in Android
- How to kill a process/package from ADB in Android
- How to transfer files using adb push/pull command in Android
- How to capture the screen from adb in Android
- How to uninstall/install system apps from adb in Android
- How to change Settings values from adb in Android
- How to Factory reset with ADB in Android
- How to get logcat from ADB command in Android
- How to capture Heap Dump from app with ADB in Android
- How to force stop an app with adb in Android
- How to start/stop a service from adb in Android
- How to send/broadcast an intent from adb command in Android
- How to start an activity from adb in Android
- How to generate input from adb in Android
- How to check SQLite DB table in Android Studio
- How to get memory info and thread list from adb in Android
- Android - Uri, Scheme and SSP(Scheme Specific Part)
- How to parse a xml file with XmlResourceParser in Android
- Android - Signing an apk with Platfom key
- How to fix "Cleartext HTTP ... not permitted" for Android development
- How to fix "kvm permission denied" for Android Emulator
- Using ADB over Wifi for Android development