由于我是10.14系统,软件支持不够,只能手工开启hdpi。原理在 这篇博文 已经分享过了,这里只是摘录一下,供大家参考。
BacklightDisplay:内置显示器,
AppleDisplay-10ac-41ac:外接显示器,10ac=厂商号(我的是DELL),41ac是产品号
-------
➜ ~ sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool true
Password:
➜ ~ ioreg -lw0 | grep IODisplayPrefsKey
| | | | "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@0/display0/AppleBacklightDisplay-610-a029"
| | | | "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@2/display0/AppleDisplay-10ac-41ac"
➜ ~ mv Downloads/DisplayProductID-d06e.plist Downloads/DisplayProductID-41ac.plist
➜ ~ cat Downloads/DisplayProductID-41ac.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DisplayProductName</key>
<string>DELL U2719DS </string>
<key>DisplayProductID</key>
<integer>16812</integer>
<key>DisplayVendorID</key>
<integer>4268</integer>
<key>scale-resolutions</key>
<array>
<data>AAAKAAAABaAAAAABACAAAA==</data>
</array>
</dict>
</plist>
➜ ~ sudo cp Downloads/DisplayProductID-41ac.plist /System/Library/Displays/Contents/Resources/Overrides/DisplayVendorID-10ac/DisplayProductID-41ac
Password:
cp: /System/Library/Displays/Contents/Resources/Overrides/DisplayVendorID-10ac/DisplayProductID-41ac: Operation not permitted
➜ ~
-------
小结:
1. 首先要拿到厂商号和设备号,用于在 网页 填写分辨率配置文件;
2. 分辨率配置文件的命名规范如下:
/System/Library/Displays/Contents/Resources/Overrides/DisplayVendorID-16进制厂商号/DisplayProductID-16进制设备号
3. 禁用“无根”系统完整性保护的方法如下:
重启->cmd+R->csrutil disable; reboot
在这个模式下可操作的文件夹很小,所以说要reboot后操作;然后再进一次cmd+r,开启csrutil