mac App 在实机 macOS 10.15 运行正常,在虚拟机系统因为签名崩溃,如何解决?

2021-04-19 23:42:32 +08:00
 Apol1oBelvedere

一个 mac App 在实机 macOS 10.15 运行正常,使用没有问题。但是把 App 放到 VirtualBox6.1.17 的 macOS 10.15 虚拟机里面运行,就出现应用打开崩溃,尝试了图下办法:

该怎么办?为什么实机与虚机有这个差别?

717 次点击
所在节点    问与答
8 条回复
nieyujiang
2021-04-20 08:13:51 +08:00
也不说用的什么证书
Apol1oBelvedere
2021-04-20 19:52:00 +08:00
@nieyujiang 如果是指 CodeSigner 的证书,我没有设置证书,该如何设置?如果是其他证书,我没有设置,能指导一下吗?
nieyujiang
2021-04-20 19:55:27 +08:00
想要签名给其他机器用,需要用 developer id 证书,付费的,签名以后公证,不然各种问题
Apol1oBelvedere
2021-04-20 20:42:56 +08:00
@nieyujiang
我按照网络上的方法 sudo codesign --force --deep --sign - 文件位置(直接将应用拖进去即可),已经显示 /app path : replacing existing signature 。但是运行还是出错:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000184
Exception Note: EXC_CORPSE_NOTIFY
为什么别人能成功我无法成功?
Apol1oBelvedere
2021-04-21 22:32:33 +08:00
@nieyujiang 目前再次进行了探索,推测可能是宿主机的 Intel x86 CPU 不能被虚拟机转换为 App 能识别和使用的类型。有什么办法完全模拟 mac 的 CPU ?
nieyujiang
2021-04-21 23:16:03 +08:00
报错信息看看有没有 reason 之类的关键词,这就是切入点,没有就看异常类型
Apol1oBelvedere
2021-04-22 20:15:23 +08:00
@nieyujiang 有这个关键词:

Time Awake Since Boot: 99 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000184
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Apol1oBelvedere
2021-04-22 20:44:46 +08:00
@nieyujiang 搜索资料可能是引用 NULL 指针引起的 crash 日志,有误办法绕过或修复引用 NULL 指针错误?
---因为这个软件在 macbook 上直接秒运行无任何问题。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/771771

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX