It's extremely easy to use: brew cask install ngrok It works over the Internet, and not the local network. If you want access with another mobile device, you have to first disconnect the first one (disable USB Debugging), connect the new one (enable USB Debugging), and run adb reverse tcp:4000 tcp:4000 again.ĮDIT: this solution has been reported to also work with Windows.Īnother solution that should always work is ngrok (as mentioned in other answers). The downside is that this works only with a single mobile device at a time. Now, on the mobile device, you can navigate to and it will actually connect to the laptop, not the mobile device.Use your custom port number instead of 4000.On laptop, run adb reverse tcp:4000 tcp:4000.
This solution works for me (tested with a MacBook): That is, my MacBook seems to refuse the connection attempt from my mobile. With the simple solution (just access laptop_ip_addr:port from mobile device, when mobile and laptop are on the same WiFi), I get a ERR_CONNECTION_REFUSED error.
The above ip command can be abbreviated to: ip a For example to use ip command to display a network configuration run the following: ip address The new and recommended alternative for examining a network configuration on Debian Linux is ip command. NOTE: The ifconfig command has been deprecated and thus missing by default on Debian Linux, starting from Debian stretch. Otherwise use something like xip.io or ngrok.
there's a bunch of suggestions on how to have a similar output on Windows.
on Linux the one-liner ifconfig | grep "inet " | grep -v 127.0.0.1 will yield only the important stuff.type into the command line ipconfig (Windows) or ifconfig (Unix).To find out the IP address of your desktop: If both your desktop and phone are connected to the same WiFi (or any other local network), then use your desktop IP address assigned by the router (not localhost and not 127.0.0.1). USB doesn't provide network to mobile device.