Chrome添加调试机型

  1. 打开chrome,按F12。选择toggle device toolbar。切换到手机模拟器模式,手机类型下拉列表,选择Edit

1.jpg

  1. device name 输入设备名称 如 HuaWei P10

  2. device pixel ratio(设备像素比),一般是输入2

  3. 输入手机分辨率的width、height(如果像素比是2,19201080分辨率的手机,在这里widthheight就要输入540*960 )

  4. 输入user agent string。用js去获取 如:alert(navigator.userAgent);
    获取到的字符串为:

MoZilla/5.0(Linux; U; Android
8.0.0: Zh-cn; VTR-TLOO Build/
HUAWEIVTR-TLOO) AppleWebkit/
537.36(KHTML, like Gecko)
Version/4.0 Chrome/
57.0.2987.132 MQQBrowser/8.8
Mobile safari/537.36

VTR-TLOO Build/HUAWEIVTR-TLOO 填入 user agent string
2.jpg

发布了152 篇原创文章 · 获赞 18 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/tanhongwei1994/article/details/100576369
今日推荐