捆绑 mac 应用程序时出现问题
我正在尝试制作一个 mac 应用程序包。它捆绑在一个 shell 文件中。结构是这样的:
App
Contents
Info.plist
App.command
MacOS
Resources
App.icns
但是,当我双击应用程序包时,它会显示以下提示:
要打开classroom.command,您需要安装Rosetta。您想现在安装吗? 看来
我的应用程序包不是基于英特尔的。但这没有意义。 Shell脚本跟什么平台没有关系吧?
我通过获取 .app 根文件夹的信息来验证它。我可以看到“种类”是“应用程序”。而在其他可启动的应用程序上,我看到“种类”是“应用程序(英特尔)”。我在 Info.plist 中错过了什么吗?
I'm trying to make a mac app bundle. It is bundled around a shell file. The structure is like this:
App
Contents
Info.plist
App.command
MacOS
Resources
App.icns
However, when I double click on the app bundle, it shows the following prompt:
To open classroom.command, you need to install Rosetta. Would you like to install it now?
It seems that my app bundle is not intel-based. But it doesn't make sense. Shell scripts have nothing to do with what platform it is right?
I verified it by getting info on the .app root folder. I can see that the "Kind" is "Application". Whereas on other launchable apps, I see that the "Kind" is "Application (Intel)". Is there something I missed from Info.plist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 MacOS 假定它是 Intel,除非明确告知它支持 ARM64。
我已经能够通过添加包含以下内容的文件
/Contents/Info.plist
来做到这一点:此外,
LSArchitecturePriority
值似乎已被缓存(或至少 Rosetta不会重新考虑运行该应用程序)...并且似乎将 CFBundleIdentifier 更改为其他任何内容就足以让它重试。我不认为这是相关的,但我确实看到有人提到arm64程序需要签名,我一直在尝试使用以下方法来做到这一点(使用临时身份),但我认为没有必要(也许二进制文件需要):
It looks like MacOS assumes it's Intel unless told explicitly that it supports ARM64.
I've been able to do that by adding the file
/Contents/Info.plist
with this contents:Also, the
LSArchitecturePriority
value seems to be cached (or at least Rosetta would not re-consider running the app)... and it seems that changing theCFBundleIdentifier
to anything else was enough to get it to try again.I don't think this is relevant, but I did see someone mention that arm64 programs needed to be signed, I had been trying to do that with the following (using the ad-hoc identity), but I don't think it's necessary (maybe it's required for binaries):
Rosetta 是一款可以在 Intel Mac 上运行 PowerPC 代码的软件。根据您的处理器、操作系统,您可能需要安装它才能运行应用程序。
这是完整的解释
Rosetta is a piece of software through which PowerPC code can be run on an Intel Mac. Sow depending on your proccessor,OS you might need to instal it to run the application.
here is the full explanation