0

我正在尝试通过 Apple 远程桌面设置 Firefox 在 130 台 Mac 上以 32 位模式打开的首选项。最简单的方法通常是defaults write不幸的是我还没有找到任何关于此的文档,而且我无法弄清楚编写不在根级别的字符串的语法。

该文件是~/Library/Preferences/com.apple.LaunchServices.plist

我需要将字符串更改x86_64i386

<dict>
<key>LSArchitecturesForX86_64v2</key>
<dict>      
    <key>org.mozilla.firefox</key>
    <array>
        <data>
        Ym9va2QCAAAAAAQQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        AAAAAAAAAAAAYAEAAAwAAAABAQAAQXBwbGljYXRpb25zCwAAAAEB
        AABGaXJlZm94LmFwcAAIAAAAAQYAAAQAAAAYAAAACAAAAAQDAABq
        ix4BAAAAAAgAAAAEAwAAWYNjAQAAAAAIAAAAAQYAADwAAABMAAAA
        CAAAAAAEAABBtfgZbgAAABgAAAABAgAAAgAAAAAAAAAPAAAAAAAA
        AAAAAAAAAAAAAAAAAAEFAAAMAAAAAQEAAE1hY2ludG9zaCBIRAgA
        AAAEAwAAAICcregAAAAIAAAAAAQAAEG0QBQYAAAAJAAAAAEBAAA0
        NkFGNUYyOC1DNTExLTM0MEMtQkU1RS1DREYzMTgyQThFOTIYAAAA
        AQIAAIEAAAABAAgA7z8AAAEACAAAAAAAAQAAAAEAAAABAQAALwAA
        AAQAAAADAwAAAAAAIBkAAAABAQAAL0FwcGxpY2F0aW9ucy9GaXJl
        Zm94LmFwcAAAAMwAAAD+////AQAAAAAAAAAQAAAABBAAACwAAAAA
        AAAABRAAAFwAAAAAAAAAEBAAAHwAAAAAAAAAIBAAABgAAAAAAAAA
        MBAAAEwAAAAAAAAAQBAAAGwAAAAAAAAAAiAAACQBAAAAAAAAECAA
        AKQAAAAAAAAAESAAANgAAAAAAAAAEiAAALgAAAAAAAAAEyAAAMgA
        AAAAAAAAICAAAAQBAAAAAAAAMCAAAJwAAAAAAAAAAdAAAJwAAAAA
        AAAAENAAADABAAAAAAAAAP8AADwBAAAAAAAA
        </data>
        <string>x86_64</string>
    </array>
</dict>
4

1 回答 1

1

我认为没有办法使用默认值(嗯,有,但它涉及转储整个 LSArchitecturesForX86_64v2 字典,编辑它,然后重新导入)。但是 PlistBuddy 可以完成这项工作:

/usr/libexec/PlistBuddy -c "set :LSArchitecturesForX86_64v2:org.mozilla.firefox:1 i386" ~/Library/Preferences/com.apple.LaunchServices.plist

在将任何东西部署到 130 台计算机之前,通常需要注意的是:首先对此进行测试(我尝试过一次……),然后将其备份到每台计算机上的相关文件,这样如果确实出现问题,您可以将其回滚。

于 2012-10-08T19:07:31.367 回答