Is it possible to open developer tools console in

2019-03-08 22:57发布

An AngularJS application works fine on desktop, but is not rendering properly on mobile (actual code is showing). This is on an Android phone.

I would like to see what errors are showing in the console.

Is it possible to open JS console on chrome app on mobile (like it is on desktop)?

3条回答
对你真心纯属浪费
2楼-- · 2019-03-08 23:08

When you don't have a PC on hand, you could use Eruda, which is devtools for mobile browsers https://github.com/liriliri/eruda
It is provided as embeddable javascript and also a bookmarklet (pasting bookmarklet in chrome removes the javascript: prefix, so you have to type it yourself)

查看更多
疯言疯语
3楼-- · 2019-03-08 23:08

I you only want to see what was printed in the console you could simple add the "printed" part somewhere in your HTML so it will appear in on the webpage. You could do it for yourself, but there is a javascript file that does this for you. You can read about it here:

http://www.hnldesign.nl/work/code/mobileconsole-javascript-console-for-mobile-devices/

The code is available from Github; you can download it and paste it into a javascipt file and add it in to your HTML

查看更多
【Aperson】
4楼-- · 2019-03-08 23:12

You can do it using remote debugging, here is official documentation. Basic process:

  1. Connect your android device
  2. Select your device: More tools > Inspect devices from dev tools on pc/mac.
  3. Authorize on your mobile.
  4. Happy debugging!!
查看更多
登录 后发表回答