Use adb over tcpip in Android Studio?

前端 未结 5 1766
不知归路
不知归路 2020-12-12 10:47

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

相关标签:
5条回答
  • 2020-12-12 11:04

    In android studio, you can create a one click solution.

    1. Go to File > Settings > Tools > External Tools
    2. Create a tool with the following settings, making sure to replace the path to adb with your path

    1. Press Ok and save the tool
    2. In Android studio, click Tools > External Tools > Android Over Wifi

    3. 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)

    1. 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

    0 讨论(0)
  • 2020-12-12 11:05

    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

    0 讨论(0)
  • 2020-12-12 11:07

    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.


    0 讨论(0)
  • 2020-12-12 11:15

    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
    
    0 讨论(0)
  • 2020-12-12 11:30

    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

    enter image description here

    0 讨论(0)
提交回复
热议问题