0

Is there a way to view js code in mobile and/or tablet device? In chrome browser we just need to press F12 , go to sources tab.

Francis Saul
  • 728
  • 2
  • 16
  • 37
  • [Remote Debugging](https://developers.google.com/web/tools/chrome-devtools/remote-debugging/) – Tushar Apr 06 '17 at 03:54
  • [How to debug web sites on mobile devices?](//stackoverflow.com/q/5794984) & [iOS Remote Debugging](//stackoverflow.com/q/11262236) – Tushar Apr 06 '17 at 03:55
  • Possible duplicate of [How to debug web sites on mobile devices?](http://stackoverflow.com/questions/5794984/how-to-debug-web-sites-on-mobile-devices) –  Apr 06 '17 at 03:58
  • Possible duplicate of [How can I debug my JavaScript code?](http://stackoverflow.com/questions/988363/how-can-i-debug-my-javascript-code) – Liam May 11 '17 at 11:10

2 Answers2

2

Use Chrome’s remote debugging feature. You can debug the page loaded in android using a remote desktop.

https://developers.google.com/web/tools/chrome-devtools/remote-debugging/?utm_source=dcc&utm_medium=redirect&utm_campaign=2016q3

Ravi Ubana
  • 397
  • 5
  • 26
0

#1 Developer Mode on (mobile device)

You need to switch on Developer Mode on your Mobile Device. Steps how to do that depend on device you are using.

For Samsung Mobile Devices: Go to Settings -> About device -> Software info -> Scroll to see 'Build number' -> tap on the screen multiply times until pop up message come up saying 'Developer Mode on'.

This will enable new option in your device Settings 'Developer options'. Within this section you will have access to many different usefull tools including one to inspect elements and preview code as per browser Developer Tool (F12).

#2 Android Device Monitor (software)

You can also use Android Device Monitor -> install it on desktop machine and connect your device to it. Once configured Android Device Monitor will collect logs from your phone and provide you with UI debugging and analysis tools.

marika.daboja
  • 881
  • 13
  • 27