在 Android Studio 中通过 tcpip 使用 adb? [英] Use adb over tcpip in Android Studio?

查看:69
本文介绍了在 Android Studio 中通过 tcpip 使用 adb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Android Studio 中为 tcpip 设备显示 adb logcat?我正在编写一个使用 USB 端口的应用程序,但我不能将它用于 adb usb.

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.

目前,我正在使用以下指令在命令提示符中查看 logcat,但如果将其集成到 AS 中会更好:http://developer.android.com/tools/help/adb.html#wireless

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

推荐答案

经过一些测试,Android Studio 已经支持这一点.您只需要执行以下 ADB 命令,现在您就可以看到 logcat,甚至可以无线加载您的应用程序.无需 USB 线!

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!

来自:http://developer.android.com/tools/help/adb.html#wireless

$ adb tcpip 5555
restarting in TCP mode port: 5555

在运行 Android Oreo 之前找出 Android 设备的 IP 地址:

设置 -> 关于平板电脑 -> 状态 -> IP 地址.记住 IP 地址,格式为 #.#.#.#.

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

设置 -> Wi-Fi -> -> IP 地址

Settings -> Wi-Fi -> -> IP address

$ adb connect #.#.#.#
connected to #.#.#.#:5555

这篇关于在 Android Studio 中通过 tcpip 使用 adb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆