如何在 MacOS 上不使用终端的情况下向 .arm64 可执行文件添加启动选项
我想知道是否有人知道如何在不使用终端的情况下使用启动选项(在本例中为“+set fs_game ...”)启动 .arm64 可执行文件? 我知道您可以在 Windows 中配置 .exe 来执行此操作,但我没有找到 MacOS 的替代方案。
I would like to know if someone know how to launch an .arm64 executable with a launch option (in this case "+set fs_game ...") without using a terminal ?
I know that you can do that in windows configuring the .exe but I don't find an alternative for MacOS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一些解决方法,但没有实际的功能可以使这变得干净或简单。
如果您有
.app
包,则可以通过附加一些参数的 shell 脚本进行重定向。如果您有一个包含以下内容的 Info.plist:那么您需要将其更改为:
并创建一个
Contents/MacOS/binary_
像这样:并给它一个
chmod +x
代码>.无论您如何启动应用程序,这都会起作用,但它会使任何现有的代码签名无效,因此如果您的应用程序已签名,则必须重新签名。
如果您有一个独立的二进制文件,或者如果您无法破坏代码签名,那么基本上唯一的选择就是制作一个单独的东西,以您想要的方式调用它。像这样编写一个 bash 脚本:
给它
chmod +x
并将其变成一个单独的应用程序。显然,这仅在通过该单独的应用程序调用时才有效,但它适用于任何类型的二进制文件,并且不需要重新签名任何内容(并且单独的应用程序应该只在您的扩展坞中显示一瞬间,然后再次消失)。There's a few workarounds, but no actual feature that'd make this clean or easy.
If you have a
.app
bundle, you can redirect through a shell script that appends some arguments. If you have an Info.plist with this:Then you'll want to change it to:
And create a
Contents/MacOS/binary_
like so:And give it a
chmod +x
.That'll work no matter how you launch the app, but it will invalidate any existing code signature, so if your app was signed, you'll have to re-sign it.
If you have a standalone binary or if you can't afford to break the code signature, then basically the only option is to make a separate thing that invokes it the way you want. Write a bash script like so:
Give it
chmod +x
and turn it into a separate app. This will obviously only work when invoked via that separate app, but it works with any kind of binary, and without the need to re-sign anything (and the separate app should only show up in your dock for a split second, then vanish again).