Use adb over tcpip in Android Studio? - android-studio

Is it possible to show the adb logcat for a tcpip device in Android Studio? I am writing a application that utilizes the USB port and I cannot use it for adb usb.
Currently, I am using the following instruction to view the logcat in Command Prompt, but it would be nice if this was integrated into AS:
http://developer.android.com/tools/help/adb.html#wireless

After some testing Android Studio already supports this. You just need perform the following ADB commands, and now you can see the logcat and even wirelessly load your application. No USB cable needed!
From: http://developer.android.com/tools/help/adb.html#wireless
$ adb tcpip 5555
restarting in TCP mode port: 5555
Finding out IP address of Android device prior to running Android Oreo:
Settings -> About tablet -> Status -> IP address. Remember the IP address, of the form #.#.#.#.
Finding out IP address of Android device running Android Oreo
Settings -> Wi-Fi -> -> IP address
Connect adb host to device:
$ adb connect #.#.#.#
connected to #.#.#.#:5555

In android studio, you can create a one click solution.
Go to File > Settings > Tools > External Tools
Create a tool with the following settings, making sure to replace the path to adb with your path
Press Ok and save the tool
In Android studio, click Tools > External Tools > Android Over Wifi
A prompt similar to this should pop up and you can type your phone's IP address here. (You can get this address from your phone when you enable ADB over network)
After you enter the information required, you should now be connected. Congratz and enjoy wireless debugging :).
EDIT 2019!!
Another great answer was posted on this thread but was deleted, which mentioned the existence of an IntelliJ/AndStud plugin that automates the above process. I have not tested the plugin but here is the github page for it. Gl

It's simple, open Terminal inside Android Studio and then type
adb connect "your IP address"
That's all. Remember that to use adb wireless your device must be root

I was given an Gigabyte Box with Android OS on it. The box had a USB and Ethernet port. These are instructions for getting my Windows 7 PC to connect with Android OS in order to see Debug Output on Android Studio.
How to use the USB port to debug:
1) Open Command Prompt
2) Go to wherever you stored adb.exe file
3) Type in “adb connect (Your Gateway’s IP Address)”. For example, "adb connect 192.168.1.94".
The IP address of the Android device can be found in Settings icon-> About tablet -> Status ->IP Address
If you’re in the adb.exe directory, other adb commands include:
1) adb devices= Finds all devices currently connected to your computer.
2) adb kill-server= Disconnects the devices
Ethernet Port to Debug:
http://www.techrepublic.com/blog/software-engineer/debug-android-applications-over-ethernet/
1) Open a command prompt and navigate to the directory where your copy of ADB.exe lives.
2) Type "adb tcpip 5555" and press Enter.
3) Type "adb connect 1.1.1.1:5555", replacing the 1.1.1.1 with your phone or tablet's IP address.

adb devices
adb tcpip 5555
adb connect 192.168.4.23
Unplug you device and run the adb connect 192.128.4.23 command again
For further details Check this article

Related

how to map Android Studio device name to ADB device name?

In Android Studio's Device Manager, the virtual device name is
New Device API 30 1
After I launched it from Android Studio, I can see it in 'adb devices' output as
C:\>adb devices
List of devices attached
emulator-5554 device
If I only have one device running, there is no confusion.
If I have multiple, is there a way to tell which is which?
Background
when I start emulator in a script, I need to use the Android Studio device name.
emulator -avd New_Device_API_30_1
but when I connect my Appium Python client to Appium server, I need to use the ADB device name
in desired_cap
driver = webdriver.Remote(f"http://127.0.0.1:4723/wd/hub", {"appium:deviceName":"emulator-5554", ...})
I need to automate these two steps.
Thank you
You can specify the port when you start the emulator then you will know the device name
emulator -avd New_Device_API_30_1 -port 5558
then you will see
adb devices
List of devices attached
emulator-5558 device
otherwise they will be selected in the order they are started.

Android studio do not show devices for flutter

I am new to Flutter and android studio, I followed the instructions of flutter.io , I created a blank app, and while I try to run I am unable to see the device lists. but it is available in device manager
Please see the screenshot.
Go to Tools->Troubleshoot Device Connections.
Connect your device over USB
If your device name does not show here then your USB or device has a problem.
You have to enable USB Debugging on your device.
Restart ADB Server.
I hope this addresses your issue.
You've not run your device....
Under Actions Click the Run button......
The emulator will start and your problem solved..

How can i run my android application on nexus 5 mobile phone

Android Studio 2.1.2,
Android 6.0 API Level 23,
Mobile Google Nexus 5,
I am trying to debug my application on my mobile phone instead on the emulator. Adb didn't show my nexus 5 in the connected device. Adb says USB device not found.
Although windows explorer shows device is connected.And I have also enabled USB debugging and developer option mode on the nexus 5 mobile.
How can i run my android application on nexus 5 mobile phone.
Please help
You will need to begin by going to the SDK Manager. Since we have been using Android Studio so far it is just as easy to navigate to it through the IDE by going to Tools->Android->SDK Manager.
Search for “Google USB Driver”
Then make sure you place a checkmark in “Google USB Driver” and hit the install packages button.
For 32 bit user go to:
C:\Program Files (x86)\Android\android-studio\sdk\extras\google\usb_driver”
And for 64 bit user go to:
C:\Program Files\Android\android-studio\sdk\extras\google\usb_driver”
Click on android_'winusb.inf' and install it.
After the installation go to your device.
In setting tap on “Developer options” and place a checkmark in “Stay Awake” and “USB Debugging”.
Now connect your device to your USB port on your computer.
Place a checkmark in the “Always allow from this computer” and hit “OK”. You are now free to open Android Studio and run your app on your local device!
u can download this driver via this link http://adbdriver.com/upload/adbdriver.zip
and Enable Developer Options
and Enable "USB Debugging"
Download ADB Driver Installer from http://adbdriver.com/downloads/ and open it.
Connect your device to your USB port on your computer.
When your device appears in the ADB Driver Installer, select it and hit install button.
Now you have successfully installed the driver and your mobile will be connected.

How to enable emulator control in android device monitor

This is my screen shot of my problem which am facing. Help me to enable this emulator control in android device monitor.so can you help me with the solution ?
Enable telnet client on your computer.
If you are windows user follow this step:
1.go to control panel
2.go to programs and features
3.click on "turn windows feature on or off" a prompt box will be appear()
4.mark the checkbox of Telnet Client
5.open command prompt and type "telnet localhost port_number" (see cmd image) after this connection will be establish.
device monitor in android studio only works for the default emulators. It does not work for genymotion or mobile device.

How can I connect my Sony Xperia C4 E5333 to Android Studio?

I want to connect my Sony Xperia C4 E5333 to Android Studio for debugging my app, but Android Studio does not show my phone in ADB window.
I tried to install the USB driver for my phone but I can not find an USB driver for the E5333 model. In ADB, I have the Google USB driver installed. I installed Sony PC Companion 2.1, but when it tried updating, I got an error.
How can I connect my phone to Android Studio?
You need to install Sony driver for your phone, not Google USB Driver.
This one should do it: http://developer.sonymobile.com/downloads/drivers/xperia-c4-driver/
Also, you need to get to developer options and enable USB debugging. After that you are good to go.
Get the latest Google Usb Driver from SDK MANAGER > EXTRA
Open Device manager.
in Other Devices find your phone with a ? mark beside it
Right click on it and choose Update Driver. You would see this screen,
Choose Browse My Computer For Driver Software. You would see this screen,
Choose Let me pick from a list of device drivers from my computer. You would see this screen,
Choose Android Device and click Next. You would see this screen,
Choose Android Adb Interface and then click on Have Disk. You would see this screen,
Browse to where you installed your Sdk, SDK_PATH > extras > google > usb_driver
Click ok then next and your device installed !
if you still don't see your device type these commands in your cmd
adb kill-server
adb start-server

Resources