Issue
I have a javascript web app built using VS code, and I want to test it in a real Android device. What are the steps to take to do that?
P.S. I’ve been searching online but didn’t find any useful answer. Those solutions just test it in a simulator. Does using a mobile device view in Chrome developer tools sort of similar to testing it in the simulator?
Here is the part of the meta tag in the header of my index.html file
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
which inform the borwser to open the app without a menu bar.
Solution
- Run you web application locally (localhost:xxxx).
- Connect your actual android device to your system.
- Open Chrome and go to
chrome://inspect/#devices
. - Select the
port forwarding
and setup arule
(ie.port - xxxx
,address - localhost:xxxx
) and make sure to checkEnable port forwarding
. - Now you can just navigate to
localhost:xxxx
and run your application on your android device.
For more reference you can checkout this document.
Answered By – varun agarwal
Answer Checked By – Clifford M. (FlutterFixes Volunteer)