Android wifi debug android studio

Беспроводная отладка Android 11

Режим дебага по WiFi теперь доступен, начиная с версии ОС Android 11. Давайте разберемся, как подключить устройство по Wi-Fi и смотреть логи в Logcat.

Нам необходимо убедиться, что у нас имеется все необходимое для соединения, а именно:

  1. установлен компонент Android SDK Platform-Tools версии не ниже 30.0.0 (April 2020), но естественно необходимо поставить последнюю версию, в которой разработчики пофиксили существующие на данный момент баги;
  2. включенрежим разработчика на вашем устройстве;
  3. на устройстве версия ОС Android 11.

Переходим в режим разработчика на нашем устройстве и активируем «Отладку по Wi-Fi».

Далее необходимо выбрать раздел «Подключить устройство с помощью кода подключения».

В боттомшите отобразится сам код подключения к устройству и IP-адрес и порт.

Откроем Android Studio, перейдем во вкладку Terminal, далее введем и выполним команду adb pair ipaddr:port где ipaddr и port — данные из боттомшита «Подключение к устройству». Следующим шагом — вводим код подключения и получим push на устройство об успешном подключении.

Перейдем на вкладку Logcat и все, что нам осталось — выбрать наше устройстве из списка подключенных устройств, в конкретном примере это Samsung SM-N985F.

Источник

Как отлаживать в Android Studio используя adb через WiFi

Я могу подключиться к своему телефону с помощью ADB Connect, и я также могу ADB Shell.

Но когда я иду в Run-> Device Chooser, там нет никаких устройств.

Что я должен сделать, чтобы подключить мою (подключенную) adb Android Studio?

Когда я подключаю его через USB, он появляется в списке

Вы можете найти инструмент adb в/platform-tools /

Вы можете проверить свои устройства, используя:

Установите порт TCP:

Чтобы установить соединение Wi-Fi, вы должны проверить IP вашего устройства и выполнить:

Попробуйте ниже плагин для Android студии

КАК

  1. Подключите устройство к компьютеру с помощью USB-кабеля.
  2. Затем нажмите кнопку на панели инструментов и отключите USB, когда плагин подключит ваше устройство через WiFi.
  3. Теперь вы можете развернуть, запустить и отладить ваше устройство, используя ваше соединение WiFi.

ПРИМЕЧАНИЕ: Помните, что ваше устройство и ваш компьютер должны быть в одном и том же соединении WiFi.

Шаг 1: Перейдите на свой Android sdk folder -> platform tools и скопируйте весь путь

Например: C:\Program Files (x86)\Android\android-sdk\platform-tools

Шаг 2: Перейти к командной строке или терминалу Android Studio

cd C:\Program Files (x86)\Android\android-sdk\platform-tools

Шаг 3: Подключите ваше устройство и систему с тем же Wi-Fi.

Шаг 4: Введите adb tcpip 5555 и нажмите Enter ,.

Шаг 5: Введите adb connect x.x.x.x:5555 , заменив xxxx на свой IP-адрес телефона ,.

узнать IP-адрес телефона

Settings -> About phone -> Status (некоторые телефоны могут отличаться)

Примечание. В случае, если вы подключаете более одного устройства, отключите другие телефоны, кроме того, который требуется подключить.

Снимок экрана командной строки:

Я использовал следующие шаги для успешной отладки через соединение Wi-Fi. Я рекомендую это решение для всех, кто испытывает проблемы с помощью интегрированных решений, таких какAndroid WiFi ADB плагин . В моем случае не удалось сохранить соединение Wi-Fi с моим устройством после отключения USB. Следующее решение преодолевает эту проблему.

Читайте также:  Камера с системой android

1. Подключение устройства

а. Подключение устройства по локальной сети

Если у вас есть локальный WLAN, вы можете подключить ваше устройство Android и ваш компьютер к этому WLAN . Затем определите IP-адрес устройства Android, просмотрев его настройки WLAN.

б. Подключение устройства напрямую через точку доступа

Я предпочитаю подключаться к точке доступа на устройстве. Это более приватно и не открывает ваше отладочное соединение с (публичным) wlan.

  1. Создайте точку доступа Wifi на устройстве Android
  2. Подключите компьютер к точке доступа
  3. На ПК просмотрите состояние сетевого подключения этого подключения к точке доступа, чтобы найти IPADDRESS вашего устройства.
    Моя система показала IPADDRESS 192.168.43.1

2. Создать отладочное соединение

  1. Подключите ваше устройство к USB.
  2. Введите команду adb tcpip 5555 , чтобы открыть порт на устройстве для подключения adb.
  3. Создать беспроводное соединение для отладки adb connect IPADDRESS .
    В моем случае команда выглядела как adb connect 192.168.43.1

Команда adb devices -l теперь должна отображать два устройства, если все в порядке. Например:

3. Сохранение отладочной связи

Сложная часть возникает при отключении USB-соединения. В моем случае оба соединения закрываются немедленно! Это может быть не для всех пользователей. Для меня это было причиной того, что я не смог использовать Android WiFi ADB плагин для Android studio . Я решил проблему, вручную переподключив Wi-Fi после отключения USB от

После этого adb devices -l показывает одно устройство, подключенное к Wi-Fi. Это устройство также отображается в Android Studio и может быть выбрано для отладки. Когда соединение нестабильно, вам может понадобиться время от времени повторять вышеуказанную команду, чтобы восстановить соединение.

Источник

Android wifi debug android studio

Android WiFi ADB — IntelliJ/Android Studio Plugin

IntelliJ and Android Studio plugin created to quickly connect your Android device over WiFi to install, run and debug your applications without a USB connected. Press one button and forget about your USB cable.

Android WiFI ADB plugin adds a button to your IntelliJ/Android Studio Toolbar to connect your device to your computer over WiFi.

To use this plugin the project opened in your IntelliJ/Android Studio has to be an Android project configured with the Android SDK.

Archived repository: Maintaining this project up to date for all the different Android devices without having access to the physical devices is not possible at all right now. Most of the bugs reported ar related to the adb installation and not to the plugin code so this repository will keep archived for now.

Connect all devices button:

Connect your device to your computer using a USB cable. Then press the button, and a notification will pop up saying that the phone has been connected. Disconnect your USB once the plugin shows your device is connected. Open the Android WiFi ADB tab at the right side to see all the devices and manage your connections. Your device will be connected over WiFi now. You can now deploy, run and debug your device using your WiFi connection. Remember that your device and your computer have to be in the same WiFi connection. Also, you have to first connect your device with a USB every time you open Android Studio, for setting up the connection over WiFi.

If you want to handle your devices connection individually, open the Android WiFi ADB dashboard you will find at the right of your IDE.

Download and install Android WiFi ADB directly from Intellij / Android Studio: Preferences/Settings->Plugins->Browse Repositories

Alternatively, you can download the plugin from the JetBrains plugin site and install it manually in: Preferences/Settings->Plugins->Install plugin from disk .

Читайте также:  Чистка компьютера от мусора андроид

Build the project

If you need some information about how to build this project review IntelliJ Idea’s Gradle Plugin documentation.

Do you want to contribute?

Please, do it! If you have any improvement or you’ve found any bug, send a pull request with the code or open an issue 🙂

Источник

How to debug in Android Studio using adb over WiFi

I’m able to connect to my phone using adb connect, and I can adb shell also.

But when I go to Run->Device Chooser, there are no devices there.

What should I do to connect my (connected) adb Android Studio?

When I plug it in through USB, it shows up on the list

19 Answers 19

You can find the adb tool in /platform-tools/

You can check your devices using:

To init a wifi connection you have to check your device IP and execute:

Step 1: Goto your Android sdk folder -> platform tools and copy the whole path

For example: C:\Program Files (x86)\Android\android-sdk\platform-tools

Step 2: Goto command prompt or Android studio terminal

windows users cd C:\Program Files (x86)\Android\android-sdk\platform-tools

Mac Users /Users/ /Library/Android/sdk/platform-tools

and press enter

Step 3: Connect your device & system with same wifi.

Step 4: Type adb tcpip 5555 and press Enter .

Step 5: Type adb connect x.x.x.x:5555 , replacing the x.x.x.x with your phone IP address.

find out phone IP address

Settings -> About phone -> Status (some phones may be vary)

Note: In case that you connect more than one device, disconnect other phones except the one you need to connect.

Command prompt screen shot:

For mac users -> if you face «adb command not found error» try this link

Try below android studio plugin

HOW TO

  1. Connect your device to your computer using a USB cable.
  2. Then press the button on the toolbar and disconnect your USB once the plugin connects your device over WiFi.
  3. You can now deploy, run and debug your device using your WiFi connection.

NOTE: Remember that your device and your computer have to be in the same WiFi connection.

I used the following steps to successfully debug over wifi connection. I recommend this solution to everybody experiencing problems using integrated solutions like Android WiFi ADB plugin. In my case it failed to keep the Wifi connection to my device after unplugging USB. The following solution overcomes this problem.

1. Connecting device

a. Connecting device using local wlan

If you have a local wlan you can connect your android device and your pc to this wlan. Then identify the IP address of the android device by looking into its wlan settings.

b. Connecting device directly using a hotspot

I prefer to connect with a hotspot on the device. This is more private and does not open your debugging connection to the (public) wlan.

  1. Create a Wifi hotspot on the Android device
  2. Connect PC to hotspot
  3. On PC look into network connection status of this hotspot connection to find the IPADDRESS of your device.
    My system showed IPADDRESS 192.168.43.1

2. Create debugging connection

  1. Connect your device to USB.
  2. Issue command adb tcpip 5555 to open a port on the device for adb connection.
  3. Create wireless debugging connection adb connect IPADDRESS .
    In my case the command looked like adb connect 192.168.43.1

The command adb devices -l should now display two devices if everything is ok. For example:

Читайте также:  Как увеличить встроенную память андроида

3. Keeping debugging connection

The tricky part comes when unplugging the USB connection. In my case both connections are closed immediately! This may not be the case for all users. For me this was the reason that I could not use Android WiFi ADB plugin for android studio. I solved the problem by manually reconnecting the Wifi after unplugging usb by

After that adb devices -l shows a single wifi connected device. This devices shows also up in android studio and can then be selected for debugging. When the connection is unstable you may need to repeat the above command from time to time to reactivate the connection.

Android wifi ADB was earlier working on my IDE but after Updating Android Studio (my current is Android Studio 3.3) it is not working and always prompt as «Unable to connect to device. Same network»

After spending much time i was unbale to resolve the issue.

Then i tried — WIFI ADB ULTIMATE by

It worked for me.

You may need to restart your adb via Android Studio (do it twice for good measure).

0pen android studio and follow this path

Go to -> settings -> plugins -> Click on Browser repositories

after that search for WIFI ADB ULTIMATE then click on install.

First time you have to connect it using USB.

You can check its working on github. For more details kindly refer WIFI ADB ULTIMATE

If you are using a rooted phone then try this application WiFi ADB.
Probably this is the most simplest way to debug on wifi.
I am using this application from many days and it works flawlessly.

I’m using AS 3.2.1, and was about to try some of the plugins, but was hesitant realizing the plugins are able to monitor any data..

It’s actually really simple doing it via the Terminal tab in AS:

  1. Turn on debugging over WiFi in your phone
    • Go to developer options and turn on «ADB over network»
    • You’ll see the exact address and port to use when connecting
  2. Go to the Terminal tab in Android Studio
  3. Type adb tcpip 5555
  4. Type your ip address as seen in developer options i.e. adb connect 192.168.1.101
  5. Now you’ll see your device in AS «Select deployment target» dialog

Here are simple steps to implement Android App debugging using ADB over wifi:

Required: You need to connect android device and computer to the same router via wifi. You can use Android Wifi tethering also.

Step 1: Connect Android device via USB (with developer mode enabled), and check its connection via adb devices .

Step 2: Open cmd/terminal and the path of your ../sdk/platform-tools.

Step 3: Execute command adb devices .

Step 4: Execute command adb -d shell (for device) OR adb -e shell (for emulator). Here you will get the shell access to the device.

Step 5: Execute command ipconfig (Windows command) or ifconfig (Linux command) and check the ip-address of it.

Step 6: Not disconnect/remove device USB and execute command adb tcpip 5000 , to open tcpip socket port 5000 for adb debugging. You can open it on any port which is not currently occupied.

Step 7: Now execute command adb connect :

. eg: adb connect 192.168.1.90:5000 (where ip-address is device’s wifi address and port which you have opened).

Now, run adb device and check the debugging device is now connected wirelessly via wifi.

Источник

Оцените статью