Thursday, March 21, 2019

How to capture an Android chrome console log?


Today I am going to tell you about how to capture android chrome console log.
Chrome DevTools allows users to capture a console log using a Chrome browser on an Android device, while connected to a computer, using this technique you can debug a website of android chrome.


Requirement :

1.Chrome 32+  on your Mac/Windows machine
2. A USB cable for Android phone to connect to Mac/Windows machine

On Android:
1.OS Android 4.0 +
2. Chrome Browser On Android
3.Enable USB debugging by going to Android Developer option(Enabling this will allow you collect a mobile device log and web console log from the device)


 How To enable USB Debugging?

1.Go to  an Android Setting>>System>>Developer option>>Enable USB Debugging

Those who don’t see developer option please follow this first:

1.Go to Settings > About Phone > >Tap on "Build number" 7 times (you will be notified that the developer options are enabled.)


Now let see how to capture log

1.Open the Chrome browser on your dev machine (Mac/Windows)
2.Open the Chrome browser on your Mobile device as well
3.Connect android phone to dev machine using USB cable
4.a Click on 3 dots menu on the top right corner of the chrome window on your  dev machine
4.b. Click on More tools>>Developer tool

4.c Click on 3 dots menu on  devTool windows , click on Remote devices , new tab get open (Here you can see your connected mobile devices) Note: Discover USB device enabled
  


5.Select the device which is connected on your dev machine
6.You can launch the Website on your mobile chrome browser by either of  this following ways



    6.a.Enter the URL into text box  which shows on the Computer browser, and click on Open





   6.b Or else Enter the URL link in the mobile device web browser’s address bar
   7.Once the website does get open you can observe the inspect button on your computer browser
   8.Click on that inspect button







There you can see the console log J