This article originally appeared on the eBay Tech Berlin blog. This will open up a Web Inspector window that allows you to look at the DOM, styles and console log from your iPhone: You can now inspect the website displayed on your iPhone with your MacBook’s Safari by selecting it in the Develop menu: For example, if you use create-react-app, instead of going to with the IP I got here, the address to use is (don’t forget the prefix): On your phone, in Safari, use the IP address to access your locally running website. Open up a terminal and run the command “ifconfig” to see the list of current network interfaces and take note of the IP address of the last entry in the list: Then go to Develop → NAME_OF_YOUR_IPHONE and select “Connect via Network”: Check the box next to “Show Develop menu in menu bar”.Pull down the “Safari” menu and choose “Preferences”.Web developers can follow development, check feature status, download Safari Technology Preview to try out the latest web technologies, and report bugs. Get started contributing code, or reporting bugs. On the MacBook, open up Safari and make sure you have the „Develop menu“ activated (most web developers will have done this already): WebKit is the web browser engine used by Safari, Mail, App Store, and many other apps on macOS, iOS, and Linux. On the iPhone, go to Settings → Safari → Advanced and activate the switch “web inspector”:Ĭonnect the phone to your MacBook using a lightning-to-USB cable. I recently switched from an Android phone to an iPhone and discovered that it is so much easier to test my web application running on localhost on my MacBook with my new phone.
0 Comments
Leave a Reply. |