I have a local server running in my laptop. I want to access it via localhost in the android emulator. How can I do this?
You can access host machine from inside the android emulator by going to the address 10.0.2.2 inside the emulator.
For example if you have a web service accessible on localhost:8080 on your local machine, you can access the same by typing
http://10.0.2.2:8080
from inside the emulator. More details about emulator networking you can read in the official documentation
Related
I'm troubleshooting an issue on our website which I can only reproduce using an Android phone or Android emulator, not using a browser's built-in emulator. On my environment (cloud VM), the only emulator that works is BlueStacks. I am running the website locally from Visual Studio (ASP.NET Core) on port 7086. However, I can't connect to it from the emulator. I have tried connecting to 10.0.2.2:7086, but I get ERR_CONNECTION_TIMED_OUT. The only answers I can find on StackOverflow indicate that this should work, so I'm not sure what else to try. Thanks!
I have created a new app using expo init <app_name>.
When I lunch it using sudo expo start, the LAN does not work, I get Connection response timed out
My setup is WSL2 + Ubuntu 20.04, and the PC has no WiFi, but my phone is connected to the same home network via WiFi.
I've tried many of the solutions provided by posts here and other forums, including some scripts to forward ports, but none of them worked. The tunnel option does work
I am following the tutorial as it is stated here: https://nativescript-vue.org/en/docs/getting-started/vue-devtools/
I have the dev tools and the app up and running but the dev tools says "Waiting for connection..." while the app is already running on my android emulator.
How can I fix this?
Device and development computers must be in the same network.
So you need to check if your emulator has a correct connection.
10.0.2.2 is a special alias to your host loopback interface (i.e., 127.0.0.1 on your development machine)
Communication with the emulated device may be blocked by a firewall program running on your machine.
Communication with the emulated device may be blocked by another
(physical) firewall/router to which your machine is connected.
Check your devices with
tns device and adb devices then ping to their IP or telnet localhost 5554
Your host computers local IP address can be different but just use 10.0.2.2
Vue.use(VueDevtools, { host: '10.0.2.2' })
Right now, I'm running my site on my Mac OS X locally via Apache.
I'm trying to reproduce a bug that only happen on iPhone Safari. I'm trying to avoid keep pushing the code to the staging server, pull, and then, test on my phone.
Is there a way to access my local site via my phone? via some kind of IP address?
make phone connect to the same WIFI as MAC OSX
run the server on the non-localhost address (LAN DHCP allocated), noted as SRV_IP
access the SRV_IP from your phone
I am developing a blackberry application and i wanted to access the websites from my localhost( local machine). I am running the application on blackberry simulator 8350.
From my code i can browse request any website from internet and i am getting the response.
When i am trying to give the url as localhost:8080/portal/index.php, its displaying me a erro message
HTTP Error 404
description The requested resource (/portal/index.php) is not available.
I am running my apache webserver on port 8080 over windows.
How can i access my local machine website from blackberry simulator?
Please help and guide me.
Thanks
SIA
localhost always points to the machine on which the DNS resolution is performed. In your case that would be the BlackBerry simulator.
To get the simulator to send HTTP request to your dev machine, you need to specify the DNS name or the IP address of that machine. The exact name depends on what your the network configuration of the simulator and your local network is.
The problem is solved.
On My local machine i was running apache on port 8080 and MDS Service was running and binding on the same port.
Simply by changing the port for Apache on my local machine helped me to connect to my local machine and internet from Blackberry Simulator.
#Franci, thanks for your idea.