windows环境下使用chrome调试ios手机

  • 1
  • 12,602 views
  • A+
所属分类:软件

windows环境下使用chrome调试ios手机,网上找了一些资料,步骤都不太详细,踩了好多坑,还是记录一下过程。

1. 连接ios手机到pc电脑

a. 设置 - Safari - 高级 - web检查器

b. usb连接pc和手机,手机上选择信任设备,打开iturns检查是否已经连接到电脑(一定要下个iturns确保pc已经连接手机,不然后面会有问题)

2. 安装调试工具

打开PowerShell工具,windows自带,每个版本不一样,调试需要版本3以上。

1) 首先需要安装scoop

set-executionpolicy unrestricted -s cu

此时会出现提示

执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略
[Y] 是(Y) [N] 否(N) [S] 挂起(S) [?] 帮助 (默认值为“Y”): 

输入Y或者直接回车,如果不是这个提示,请升级版本

2) 然后下载安装

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

成功提示

Initializing...
Downloading...
Extracting...
Creating shim...
Adding ~\scoop\shims to your path.
Scoop was installed successfully!
Type 'scoop help' for instructions.

3) 通过scoop安装ios_webkit_debug_proxy

scoop bucket add extras
scoop install ios-webkit-debug-proxy

成功提示:

Installing 'ios-webkit-debug-proxy' (1.8.3) [64bit]
ios-webkit-debug-proxy-1.8.3-win64-bin.zip (3.4 MB) [=========================================================] 100%
Checking hash of ios-webkit-debug-proxy-1.8.3-win64-bin.zip ... ok.
Extracting ios-webkit-debug-proxy-1.8.3-win64-bin.zip ... done.
Linking ~\scoop\apps\ios-webkit-debug-proxy\current => ~\scoop\apps\ios-webkit-debug-proxy\1.8.3
Creating shim for 'ios_webkit_debug_proxy'.

'ios-webkit-debug-proxy' (1.8.3) was installed successfully!

3. 浏览器页面调试

确保手机已连接,输入如下:

ios_webkit_debug_proxy -f chrome-devtools://devtools/bundled/inspector.html

如果手机未连接上,则会出现如下错误提示:请在iturns查看是否已连接

Listing devices on :9221
device_listener: connect function failed with error 10061
No device found, is it plugged in?

连接成功会显示设备,格式基本如下

Listing devices on :9221
Connected :9222 to 瀹惰鐨?iPhone (ejdifheufhudsuhdfidhfshfdosfd)

此时在浏览器中输入http://localhost:9221/可以看到当前连接的设备

每台新的设备的端口号+1

在浏览器中输入chrome://inspect/#devices,点击port forwarding按钮,添加端口号localhost:9222,如果有新的设备累加

刷新页面,remote Target中会出现手机访问的浏览器地址,点击inspect即可调试。

白屏的话需要翻墙,见我另一篇文章有蓝灯的下载链接。

也可能是缓存的原因,浏览器地址输入chrome://appcache-internals/#清理缓存,同时清除手机safari的缓存

我的翻墙后左边还是白屏,但是右边有数据能调试,找了一圈没有解决方案,改了host也不行,就先调试了。有知道解决方案的可以留言交流。

smilelin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:1   其中:访客  0   博主  0

    • 同尘兄 同尘兄 0

      白屏的问题有没有大佬解决了啊,我的翻墙后左边是白屏,右边也没有数据,就一个空壳子