简体   繁体   中英

running html5 in an android emulator

I've just started developing an html5 game using VS Code. I see it being mainly used from pcs/laptops and have managed to set up the Chrome debugger so I can debug the webpage in chrome.

However I'd like to be able to debug it using an android emulator too, to check the screens look right, etc. I have Android Studio installed, and an emulator that works, but I can't find any VS Code debugger extensions that will launch the webpage in the browser of the emulator.

Is there any way to do it?

This method is tested both on emulator and actual physical device.

Goto Chrome. Then goto chrome://inspect/#devices .

Physical Device:

Then you can connect your phone to pc and turn on USB Debugging on your phone. Accept the debugging message on your phone. Then you get access to all chromium based apps like Chrome, Brave or other Hybrid apps developed using Cordova etc.

Emulator:

Close all emulators running. Start Android Studio. Start the emulator. Goto Android Studio logcat and check if emulated is alive. Then goto chrome://inspect/#devices .

If emulator ADB authentication fails in chrome. Goto AVD manager and wipe data of virtual device.(Only Emulator)

检查设备

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM