6

I have to debug an Android app into Android Studio; the app contains scripts written in Javascript. Is there a way to add breakpoints to line of codes written in Javascript?

cigien
  • 55,661
  • 11
  • 60
  • 99
A M
  • 739
  • 1
  • 12
  • 23
  • 1
    Yes it is possible to Debug Javescript in android, see this http://stackoverflow.com/questions/2314886/how-can-i-debug-javascript-on-android – Shailesh Sep 05 '16 at 07:09
  • Possible duplicate of [How can I debug javascript on Android?](https://stackoverflow.com/questions/2314886/how-can-i-debug-javascript-on-android) – JJJ Jan 01 '19 at 15:53

2 Answers2

2
  • Open chrome and go to DevTools ( Inspect Element),

  • click the Main Menu then select More tools > Remote devices.

  • open the Settings tab.

  • Make sure that the Discover USB devices checkbox is enabled.

  • Connect your Android device directly to your development machine using a USB cable. The first time you do this, you usually see that DevTools has detected an unknown device. If you see a green dot and the text Connected below the model name of your Android device, then DevTools has successfully established the connection to your device

  • In the Remote Devices tab, click the tab that matches your Android device model name and Click "Inspect"

check this link for debugging JavaScript on Android in details

https://developers.google.com/web/tools/chrome-devtools/remote-debugging/

cigien
  • 55,661
  • 11
  • 60
  • 99
Diptendu Das
  • 3,153
  • 4
  • 21
  • 38
2

Or easier way - in Chrome (or any Chromium-based browser as Edge) type url: chrome://inspect#devices.

cigien
  • 55,661
  • 11
  • 60
  • 99
hcj
  • 41
  • 4