How to Inspect Element on Android Device
By Jash Unadkat, Technical Content Writer at BrowserStack - June 10, 2022
Whenever a web developer encounters a UI bug, the first thing they tend to do is inspect that specific web element. Inspecting an element helps developers view and edit the HTML and CSS scripts of a specific web page on their personal screen without making any permanent changes.
Any UI bugs on a website appearing for a specific device can be easily troubleshot using the inspect element feature. Given the market share of Android users, it is necessary that developers and testers must how to inspect elements on Android phones or other devices.
Also Read: How to inspect elements on iPhone
This article discusses multiple methods on how to inspect elements on Android devices.
Different Ways to Inspect Element on Android Devices
There is more than one way to inspect elements on Android devices. In this section, we are briefly going to see about all the methods available.
- Using Real Android Devices on BrowserStack
- Using Developer Tools in Chrome and Firefox
- Using Google Chrome on an Android Device
- Using Applications
Using Real Android Devices on BrowserStack
The web is highly fragmented into different browsers (mobile and desktop) and devices (mobile, tablets, desktops). Also, let’s not forget every browser has its legacy and latest versions. From a developer’s perspective, developing a web application that provides robust performance in a highly fragmented environment is a huge challenge.
In such cases, teams need access to a comprehensive testing infrastructure that enables them to test web applications on multiple devices and browsers.
BrowserStack is one such platform that provides developers and QAs with an ideal test infrastructure. BrowserStack’s real device cloud provides 3000+ real devices and browsers to test on. This makes the process of cross browser testing and cross-device testing very convenient as QAs get the ideal environment to test their web applications in real user conditions.
Teams can pick combinations of real devices, browsers, and operating systems. For example, if a tester is wondering how to inspect elements on Chrome-Android, they can simply sign up for free and choose that particular browser-device combination on BrowserStack, as shown in the image below:
The following image demonstrates a sample live session of mobile browser testing on a real device-browser combination – Chrome on Google Pixel 6 (Android Device).
You can easily inspect any element using DevTools.
Teams also get instant access to features like:
- DevTools for real-time inspection of web elements
- Device rotation features to test Portrait and Landscape views.
- Integrations with popular bug reporting tools like Jira, Trello, and Slack
- Geo-location testing to test the behavior of websites in different geographies
Explore the full range of features for mobile testing on BrowserStack.
The methods explained above will help developers and QAs to resolve critical UI bugs faster. Testing on platforms like BrowserStack will ensure that web applications are robust and market-ready.
Using Developer Tools in Chrome & Firefox
Chrome and Firefox provide the feature of Device Simulation in their DevTools.
You can learn how to inspect elements on Android from the below steps:
- Press F12 to start DevTools on the desktop browser (applicable for both browsers)
- Click on the Toggle Device Bar option
- Now from the available options choose an Android device
- Once the user selects a specific Android device, the mobile version of the desired website starts
- Developers can now start inspecting the website on the desired Android device from their desktops
Similar steps can be taken to inspect an element on an iPhone. One just needs to select the device accordingly.
Read more: How to Inspect Elements in Chrome
Using Google Chrome on Android
You can use Google Chrome on your Android device to quickly inspect the elements. It allows you to remotely debug any element on your Android device from your desktop and laptop.
Let us now see how to do this:
- Enable developer options for the Android device
- Select USB Debugging. This creates a debug mode when the USB is connected.
- In your deployment system, open Google Chrome and type chrome://inspect#devices
- Ensure that Discover USB devices is enabled. This will list all the devices connected to the system via an USB.
- Once connected, you will see a label box next to the device name. Enter the URL and click Open.
- Now click Inspect next to the URL.
The problem with this option is that you will have to individually test every other device. This becomes cumbersome and time-consuming. It is also difficult to scale as you should have your own device lab to test on different devices using this feature.
Read More: How to Debug Website on Mobile Chrome
There are numerous applications that allow you to inspect elements available in the Play Store. These apps allow you to inspect any element and edit it. But, the problem with this approach is that these apps open on a mobile phone which has a smaller size resolution thereby making it difficult to edit. Also, in order to use this option, you will have to install the app on multiple devices, for which you need to have an in-house device lab. Using a real device cloud to test and inspect elements is a lot easier than using these third-party applications.
What is the Best Way to Inspect an Element on Android?
The reason why you as a developer or tester want to inspect an element is to identify how quickly you can fix a particular design. Given this, it makes no sense to rely on third-party applications or inspect using Chrome on Android. These two options take a long time and also require you to perform the same action multiple times on different devices. You also need to have all the devices to test using these methods. If another developer or tester is using the device then you will have to wait, leading to tester wait time. You could use emulators to inspect the element but emulators are tricky and there is no guarantee that what looks good on an emulator would look the same on a real device.
Testing on a real device cloud allows you to be confident and is also cost-efficient. You can access multiple devices at the same time, which eliminates tester wait time. BrowserStack allows you to seamlessly test on any real device, try inspecting an element using BrowserStack and you will see it for yourself.