gpt4 book ai didi

ios - 从 plutil 获取信息

转载 作者:可可西里 更新时间:2023-11-01 04:19:23 39 4
gpt4 key购买 nike

我无法从 plutil 获取方向信息。我想检查 .plist 是否包含键 CFBundleShortVersionString。我不认为 plutil 有任何选项来测试 key 是否存在,所以我想我只是:/所以我尝试使用转储选项 plutil -dump file.plist >file.txt 将 plist 文件从 stdout 定向到文件,但没有成功。 :/我还尝试将 stdout 定向到 stderr,并将 stderr 和 stdout 定向到文件。没有任何效果。我该怎么做?

最佳答案

不依赖额外实用程序安装的 Oneliner:

对于 macOS Monterey 及更高版本

plutil -extract CFBundleShortVersionString raw -o - ./Info.plist

适用于 macOS Big Sur 及更早版本 ( no raw format type )

plutil -extract CFBundleShortVersionString xml1 -o - ./Info.plist | sed -n "s/.*<string>\(.*\)<\/string>.*/\1/p"

关于ios - 从 plutil 获取信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8778368/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com