Provide an option to auto forward tcp port for Android emulators
See original GitHub issueI usually use HotReload simultaneously on Android emulator and iOS simulator, the new auto discover feature is great and allows for a scenario where I can just set a random port to avoid collision when opening multiple emulators/apps.
Unfortunately, for Android emulators, I need to know the port so I can forward it through adb
, as mentioned in the README.
My proposal: pass a -auto-forward
flag so the Observer can automatically call adb
to forward the port. I did this for my project and it is working, so if you think it makes sense, I can just open a new PR. The code looks something like this:
Inside the UdpReceived
:
if (!_addresses.Contains(address))
{
_addresses.Add(address);
var port = address.Split(':')?[2];
Process.Start("adb", $"forward tcp:{port} tcp:{port}");
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How can I forward my localhost IP-Address to an Android ...
To forward a port from your local machine to an Android Emulator, you need to have Telnet enabled. This is done through the...
Read more >Set up Android Emulator networking | Android Studio
To set up the network redirection, create a mapping of host and guest ports and addresses on the emulator instance. There are two...
Read more >Setup TCP and UDP forwarding to Android Emulator
Forwarding TCP traffic to android emulator is simple. Just use the adb tool like this to forward host port 2222 to port 3333...
Read more >Android emulator access to local server
In this solution, we'll instruct the emulator to redirect the IP address from the host machine to the loopback IP address automatically. We'll ......
Read more >Android Emulator | Android Developers
The Android emulator is a QEMU-based application that provides a virtual ARM mobile device on which you can run your Android applications.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll open a PR with this improvement.
i think this update makes sense 😃