Reputation: 716
As the title says, I need to debug a website opened with mobile Chrome on an iOS device (iPod, iPad etc.) on Windows 10. I have successfully set up iOS Safari debugging on Windows 10 via Chrome DevTools (GitHub repo , helpful comment). I would love to do the same thing except with Chrome or Firefox and not Safari. Is it even possible?
Upvotes: 17
Views: 40185
Reputation: 1979
Yes it is. You'll need node first and (web inspector enabled on iOS>Settings>Safari) then...
sudo npm -g i weinre
(or) npm i -g weinre
weinre --boundHost YOUR_IP:PORT
<script src="http://YOUR_IP_ADDRESS:PORT/target/target-script-min.js"></script>
Connect your iOS device via USB
Go to http://YOUR_IP_ADDRESS:PORT/client/
from your browser (your pc) where you want to debug and you'll see your device.
Error in Step 2
If you see any error in step 2, first check your IP via ipconfig
and then bind a similar IP with a free port that is not being used. For example my local ip is 192.168.1.5 so I used the same with a free port - 192.168.1.5:4576
Error in Step 5
If you can't see your device try adding a name myDevice
to the script in Step 3 as follows
<script src="http://YOUR_IP_ADDRESS:PORT/target/target-script-min.js#myDevice"></script>
Then in Step 5, when reaching your device add the device name to the URL as
http://YOUR_IP_ADDRESS:PORT/client/#myDevice
SUCCESS
If everything runs fine, you'll be able to inspect your code, read indexedDB, session and localStorage and see outputs in Console among other dev tools.
Upvotes: 13