0

I remember with another phone I was able to debug my local website dev, now there is a problem preventing me to open localhost in my mobile and cannot find how.

Looking at: Google Chrome for Android Remote Debugging - "localhost:9222" Not Available

my phone is connected, on localhost:9222 I can see a list of tabs.

I can access tabs loading site from remote, but cannot load my localhost.

In one case, error displayed: 408 - Timeout.

On another , simply chrome display site is not reachable. ERR_NAME_NOT_RESOLVED

I tried both with port-forward enabled as well as not (if enabled, listening to 8081, 8080).

Phone is connected via USB but seems cannot reach my localhost address of the laptop, still on same wifi spot.

EDITED

I remember with another phone I was able to debug my local website dev, now there is a problem preventing me to open localhost in my mobile and cannot find how.

I was doing with Bonjour- the "Bonjour host" is the name Mac assign to your user machine user.local. I was able to connect former android host, but now it cannot be solved anymore unless of IP.

1 Answer 1

3

The two devices should be on the same network and it won't be localhost in that case, but you have to replace localhost with the IP of the server PC!

So instead of localhost:9222, it would be 192.168.1.10:9222 giving that 192.168.1.10 is your IP address!

Sign up to request clarification or add additional context in comments.

2 Comments

sorry I forgot to mention I am using an alias hostname to make it searchable - like http://foo.local/~user/ I m "quite sure" it was resolved on other moblile (not localhost, but the alias to make it searchable in the same network). Your answer is correct, I'll mark it correct, and make me thing if my "quite sure" is not a faulty memory. But, for the sake of being correct - could you explain possible reasons of why alias is not resolved ?
@user305883 the alias is only available to the system it's written on except maybe if it's some kind of a DNS server, so if you have root to your Android phone then you can write the alias there /system/etc/hosts, or I believe there are some other methods like a DNS server for example!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.