Ebrahim Gharejelu
Ebrahim Gharejelu

Reputation: 9

How to see localhost in my smart phone with android and ios operating system

my pc connected to my modem by lan and i have access to the internet by lan. but my android device connected to my modem via WIFI and it's have access to the internet too. my pc local ip is : 192.168.1.2 and my android device ip is : 192.168.1.3 PC : Use Lan. Phone : Use Wifi. i think pc and phone is in the same network . what i want to do : I am running angular 2 application and ionic 2 mobile application on my pc under localhost with this url:http://localhost:8100 my question is this : how can i see my localhost into my android device? i get nothing in my android device. please help me with your solution thanks.

Upvotes: 0

Views: 590

Answers (2)

Carsten
Carsten

Reputation: 4208

you can serve your application on your ip. then you can access it on your phone using that ip.

ng serve --host 192.168.1.2

or

ng serve --host 0.0.0.0 --disable-host-check

Upvotes: 3

Abana Clara
Abana Clara

Reputation: 4650

Access using your PC's ip address by typing it on the browser

192.168.1.2

Try to indicate the port too if that doesnt work

Upvotes: 0

Related Questions