What is the cameo adb forward for and how to use it?

Asked

Viewed 85 times

0

I would like to know what the forward adb is and how to use it. Could someone explain me?

1 answer

1

Not much to say about adb forward, in addition to what is in the documentation: https://developer.android.com/studio/command-line/adb#forwardports

It serves to forward host ports (your computer, where the adb command is running) to other "device" ports (mobile phone or emulator), so you will have an accessible host port through another device port.

For example, if you have an HTTP server that you want to access on your phone or emulator, this command would help.

There is also the opposite/reverse, when you want to access the port of a device on your computer you should use adb reverse, for example:

adb reverse tcp:80 tcp:8000

Assuming you have port 80 on the device/emulator/phone, it will be accessible on the connected computer on port 8000.

The example with HTTP is only one use, this is not a matter of programming, but of networks and devices, which of course can help in programming as well as help in other issues, such as functionality that need to access ports from both sides (computer or device)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.