How to inspect an element on iPhone
By Jash Unadkat, Technical Content Writer at BrowserStack - March 13, 2020
In a constant endeavor to provide optimized performance across mobile devices, developers strive to build responsive websites. However, while doing so, developers might face multiple challenges.
For example, a developer might encounter a specific rendering issue that seems to occur on a specific iPhone while creating a responsive design for a website. In such cases, they need to inspect specific web elements on real devices to figure out the exact solution. Here’s where QAs and developers need to be aware of handy solutions that can help save time spent on troubleshooting.
This article aims to explain two easy methods for inspecting elements on an iPhone.
Method 1: Using Safari developer tools to inspect elements on an actual device
Apple provides a very intuitive feature that enables web developers to debug and inspect web elements on actual iPads and iPhones. One just needs to connect their iPhone and enable the Web Inspector to get started.
Enable the Web Inspector on your iOS mobile device by:
Going to Settings > Safari > Scroll down to the bottom > Open Advanced Menu> Turn on the Web Inspector
Note: This feature only works on the actual Apple Mac and not on Safari running on Windows.
One just needs to enable the “Show Develop menu in the menu bar”. The steps to do so are as follows:
- Open Safari browser
- Click on Safari > Preferences > Advanced
- Tick the checkbox Show Develop menu in the menu bar
Once done, the Develop menu will be enabled in the top-bar. Click on the Develop menu and it will show the connected iPhone in the options along with the web-page that is active on the connected device.
Click on that page and it will open the Web inspector window for the same page.
When you interact with any element in the web inspector, it immediately highlights that particular element on the iPhone in real-time. This helps developers identify exactly what they are inspecting as they continue to interact with the elements providing an interactive test experience.
Method 2: Using Cloud-based platforms like BrowserStack for Live testing on real devices
BrowserStack is a cloud-based platform that allows web-developers to test their web apps instantly for cross browser compatibility across a range of devices. Its real device cloud enables developers or QAs to instantly run manual tests on real mobile and desktop devices. For extensive testing, QAs can also use its Cloud Selenium Grid for automated cross browser testing on multiple real devices.
Developers also get instant access to Dev tools on both platforms (Android and iOS) during live testing. This allows developers to eliminate their testing pain points as they can instantly test websites across a variety of iOS devices like iPhone X, iPhone, iPhone 11 Pro, and many other earlier versions on desired browsers.
The image below represents a sample BrowserStack Live session running on Safari – iPhone XS
As web-developers get upfront access to the DevTools in the dashboard, inspecting specific elements on any iPhone becomes much easier for them. Developers have multiple real mobile devices to choose from and can switch between device-browser-OS combinations at any point. This ensures web-developers or QAs can quickly troubleshoot any rendering issues and fix them with minimal time and effort.
Also read: How to test mobile applications manually
BrowserStack also provides a Responsive checker that lets users view their websites on multiple mobile and desktop devices in order to verify the site’s responsive design.
It’s very important for web developers and QAs to be aware of techniques that can help them resolve critical UI bugs occurring on specific devices. The methods explained above will help them trace bugs quickly and ensure the faster release of optimized websites.