怎么强制macOS上的某个应用不使用独立显卡

背景

之前碰到过企业微信更新之后强制使用独立GPU,后面找到了快捷指令的方式禁止企业微信使用独立GPU启动,后面某个版本更新好了。

最近最近微信更新到了4.0.3.93版本,也出现了这个问题,不想再在快捷指令里启动了,因为占用菜单栏空间,所以找了一下,发现苹果官方Developer Documentation给出了修改Info.plist文件禁止应用使用独立GPU的方法,具体参考方法二。

一、快捷指令.app

  1. 新建一个归属到菜单栏的脚本式快捷指令,脚本内容就是
open -a /Applications/企业微信.app/Contents/MacOS/微信 --args --disable-gpu
  1. 下次启动的时候使用菜单栏的快捷启动方式,启动应用,就能禁止应用使用独立显卡

二、修改应收的Info.plist文件,禁止应用切换显卡,此种方式更方便

参考文档:NSSupportsAutomaticGraphicsSwitching _ Apple Developer Documentation

NSSupportsAutomaticGraphicsSwitching

A Boolean value indicating whether an OpenGL app may utilize the integrated GPU.
macOS 10.7+
————————————————————————————————————

Details

Name

Supports Automatic Graphics Switching

Type

boolean

以微信为例,修改的文件地址位于:/Applications/WeChat.app/Contents/MacOS/WeChatAppEx.app/Contents/Info.plist,修改文件的内容如下,将默认的NSSupportsAutomaticGraphicsSwitchingtrue改成false即可。


DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegionkey>
	<string>enstring>
	<key>CFBundleDisplayNamekey>
	<string>WeChatAppExstring>
	<key>CFBundleExecutablekey>
	<string>WeChatAppExstring>
	
……

	<key>NSSupportsAutomaticGraphicsSwitchingkey>
	<false/>
	<key>WMPFMainBundlekey>
	<true/>
dict>
plist>

你可能感兴趣的:(怎么强制macOS上的某个应用不使用独立显卡)