Access dev tools for debugging iPhone/iPad Safari on Windows
Came across this issue on a site where the site is crashing due to some reason on iPhone and wanted to debug. But since the debug tools is no longer on iOS(was there way back in 2012 I guess?), I was looking for an easier way to do it with my iPhone and desktop running Windows.
And unfortunately there aren’t many resources online which descibe how this can be done. So while looking around I stumbled upon a github repo remotedebug-ios-webkit-adapter which is precisely what I was looking for. I have tested this and works fine.
Below are the steps that I followed:
- Install Node
-
Install Scoop
a. Run this command to install scoop
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
b. While installing scoop you may see an error
PowerShell requires an execution policy in [Unrestricted, RemoteSigned, ByPass] to run Scoop.
Run the below command to set execution policy(Press Y and enter when prompted) and then run command 2.a again to complete it’s installation.
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
-
Run the below commands to install ios-webkit-debug-proxy
scoop bucket add extras
scoop install ios-webkit-debug-proxy
-
In cmd run the below command as adminstrator to install latest version of the adapter
npm install remotedebug-ios-webkit-adapter -g
- Install iTunes and connect your device to PC. (Tap on ‘trust’ when pop-up displayed on your phone to trust the computer). Make sure Web Inspector is enabled in iOS Settings > Safari > Advanced
-
Run the adapter using below command
remotedebug_ios_webkit_adapter -— port=9000
- Now tht the adapter is listening, open chrome and go to this link
chrome://inspect/#devices
and click on ‘Configure…’ next to Discover network targets and addlocalhost:9000
- Open the web page you want to debug on safari, you should see it on chrome inspector page under Remote Target - Target (RemoteDebug iOS Webkit Adapter)
- Click on inspect and you can access the console and network tabs to see if any errors to debug.
Below is reference url if need more info
https://github.com/RemoteDebug/remotedebug-ios-webkit-adapter