macos 通过复制治愈的 Mac OS X 10.5 应用程序“此架构不支持”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2580450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:51:46  来源:igfitidea点击:

Mac OS X 10.5 App "not supported on this architecture" cured by copying?

macoscompatibilityosx-leopardpowerpc

提问by JWWalker

I have an app that updates itself over the internet, and the updated copy won't run on PowerPC machines (G5) running Leopard (10.5.8). Double-clicking the app produces a message saying "You can't open the application "appname" because it is not supported on this architecture." But here's the weird part: if I duplicate the app using the Finder or using a cp -Rcommand, then the duplicate runs fine! And yet, if I do ls -laeRon both apps, the results are identical. I restarted the machine, and the difference between the two copies was still there.

我有一个通过互联网自我更新的应用程序,更新后的副本不会在运行 Leopard (10.5.8) 的 PowerPC 机器 (G5) 上运行。双击该应用程序会产生一条消息,指出“您无法打开应用程序“ appname”,因为该架构不支持它。但这是奇怪的部分:如果我使用 Finder 或使用cp -R命令复制应用程序,那么复制品运行良好!然而,如果我ls -laeR在两个应用程序上都这样做,结果是一样的。我重新启动机器,两个副本之间的差异仍然存在。

Sometimes, renaming the app made it run. After a few tries, I managed to rename it back to the original name and still have it run.

有时,重命名应用程序使其运行。几次尝试后,我设法将其重命名回原来的名称,但仍然可以运行。

If this was just on one machine, I'd dismiss it as disk corruption, cosmic rays, or a voodoo hex, but it was reported by a customer and then I reproduced it on my own machine.

如果这只是在一台机器上发生,我会认为它是磁盘损坏、宇宙射线或巫毒十六进制,但它是由客户报告的,然后我在自己的机器上复制了它。

Any ideas what could cause this behavior?

任何想法可能导致这种行为?

回答by JWWalker

It turns out that the Launch Services database had somehow flagged the app as unsupported, which I verified by using the semi-secret lsregistercommand line tool to dump the database. Anything that would change the mod date of the app, such as touch, sufficed to make Launch Services wake up and smell the coffee.

事实证明,Launch Services 数据库以某种方式将该应用程序标记为不受支持,我通过使用半秘密lsregister命令行工具转储数据库进行了验证。任何会改变应用程序修改日期的东西,比如touch,都足以让 Launch Services 醒来并闻到咖啡的味道。

回答by Coxy

Sounds to me like an extended attribute or some other aspect that isn't being carried over to the duplicate of the program files.

对我来说听起来像是一个扩展属性或其他一些没有被转移到程序文件副本的方面。

Maybe try looking into running the xattrcommand on the output of ls -laeRon the app bundle?

也许尝试研究在应用程序包xattr的输出ls -laeR上运行命令?