Debug Javascript code in Android Mobile Browser


Debugging the javascript code in Android is not that easy task because of the limited built-in browser of Android. Here are some tricks that can be used in order to debug javascript in android mobile. There are many ways to debug Javascript in Android. Let's check it one by one:


Debug javascript in Android

  1. Using Chrome Remote Debugging
    1. Open the Chrome in development machine and click on the options button and select Developer Tools.
    2. In the Developer Tools, you will see icon for Main menu options. Click the icon and select More tools.
    3. In the More tools, Select the Remote devices and it will open one more tab. In that you will be able to see the connected mobile devices(Make sure that your device is connected to Computer and Discover USB devices option is enabled).
    4. Select any of connected devices from the list and in that device open the chrome. Now you can start debugging in two ways:
      1. Type the url of your website in the open tab of desktop remote connection.
      2. Open the url from the mobile chrome browser ? Type the url in Android Chrome tab
    5. When the URL is loaded, click on the Inspect button in the right side of the web URL, that you want to debug.

  2. Using jsHybugger
  3. This app only supports Native Android Browser

    1. Download and Install the jsHybugger APK on your android device. It can be downloaded from their official website here jsHybugger
    2. Enable USB debugging on you device.(Go to Settings -> Tap on Build Number 7 times) Note: This procedure differs from device to device
    3. Plug the Android device into your desktop computer or laptop via USB
    4. Run the jsHybugger app on the Android device.
    5. Enter the target URL and page in the app. Press Start Service and finally Open Browser
    6. Now come back to your desktop computer and open Chrome to chrome://inspect/
    7. An inspectors window will appear with the chrome debugging tools linked to the page on the Android device.
    8. You can start debugging now.

Solution Worked 4 UpvotesUpvote
        
Solution Didn't Worked 1 DownvotesDownvote


Comments




Search