Is it possible debug iOS Chrome on Windows 10?

一笑奈何 提交于 2020-08-22 05:11:00

问题


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?


回答1:


Yes it is. You'll need node first and (web inspector enabled on iOS>Settings>Safari) then...

  1. Install weinre sudo npm -g i weinre (or) npm i -g weinre
  2. Run weinre weinre --boundHost YOUR_IP:PORT
  3. When it runs copy paste the following script to your code

<script src="http://YOUR_IP_ADDRESS:PORT/target/target-script-min.js"></script>

  1. Connect your iOS device via USB

  2. 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 bound 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.



来源:https://stackoverflow.com/questions/50986674/is-it-possible-debug-ios-chrome-on-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!