Om3ga
Om3ga

Reputation: 32823

Test mobile web app in mobile device's browser using localhost

I want to test a mobile web app on mobile device. I am currently developing my mobile web app. It is still on my local environment i.e. localhost:8080. Now I want to use same hostname and port to access this web app on my mobile device. I need this because my mobile web app is also using HTML5 Accelerometer API. I need to test if it is working. I can use google chrome dev tools to emulate responsiveness but I need to test it on real device.

How can I test it on both Android and iPhone?

UPDATE

Below is my nodejs server code

'use strict';

var express = require('express');
var app = express();

app.use(express.static('./dist'));

console.log('\n0.0.0.0:8000\n');

app.listen(8000, '0.0.0.0');

Upvotes: 1

Views: 4909

Answers (3)

GvSharma
GvSharma

Reputation: 2670

Android app "KWS"

Its a good option to test webserver,

Upvotes: 1

Alexander Hoffmann
Alexander Hoffmann

Reputation: 6014

As Rosário said, you can connect to the same Wi-fi network as your computer and type in the computer's IP in your phones browser. I don't know how experienced you are so make sure that you..

a) Use your computer's local IP. E.g. looking up your own IP on www.speedtest.net won't help since this is your public IP.

b) Type in the port in your phones browser. E.g. if your computer's IP is 192.168.0.10 then you need to type in http://192.168.0.10:8080 as the url in your browser.

Upvotes: 2

Rosário P. Fernandes
Rosário P. Fernandes

Reputation: 11326

Simply connect your mobile to the same Wi-fi network as your computer. And then Enter the Computer's IP on the mobile's browser.

Upvotes: 1

Related Questions