Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
522 views
in Technique[技术] by (71.8m points)

tcp - Use adb over tcpip in 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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...