29 maja 2017

Xamarin – uruchamianie przez Wifi, bez USB

From your device, if it is rooted

According to a post on xda-developers, you can enable ADB over Wi-Fi from the device with the commands:

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

And you can disable it and return ADB to listening on USB with

setprop service.adb.tcp.port -1
stop adbd
start adbd

From a computer, if you have USB access already (no root required)

It is even easier to switch to using Wi-Fi, if you already have USB. From a command line on the computer that has the device connected via USB, issue the commands

adb tcpip 5555
adb connect 192.168.0.101:5555

Be sure to replace 192.168.0.101 with the IP address that is actually assigned to your device.

You can find the IP address of a tablet in two ways:

Manual IP Discovery:

Go into Android’s WiFi settings, click the menu button in the action bar (the vertical ellipsis), hit Advanced and see the IP address at the bottom of the screen.

Use ADB to discover IP:

Execute the following command via adb:

adb shell ip -f inet addr show wlan0

To tell the ADB daemon return to listening over USB

adb usb

Apps to automate the process

There are also several apps on Google Play that automate this process. A quick search suggests adbWireless, WiFi ADB and ADB WiFi. All of these require root access, but adbWireless requires fewer permissions.

Komendę adb connect <ip>:<port> wpisujemy w linię poleceń:

źródło:

  1. https://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp/3623727#3623727
  2. https://stackoverflow.com/questions/31327839/adb-over-wireless-without-usb-cable-at-all

TrackBack

TrackBack URL dla tej wiadomości:
https://blog.kkthx.pl/2017/05/xamarin-uruchamianie-przez-wifi-bez-usb/trackback/

Napisz komentarz