V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Apol1oBelvedere
V2EX  ›  问与答

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

  •  
  •   Apol1oBelvedere · 2021-04-19 23:42:32 +08:00 · 715 次点击
    这是一个创建于 1165 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    • 安装 Command_Line_Tools_for_Xcode_11.5.dmg 重启,sudo codesign --force --deep --sign - 文件位置(直接将应用拖进去即可)。显示 /app path : replacing existing signature 。打开还是崩溃。
    • CodeSigner 为崩溃应用签名,还是崩溃。

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

    8 条回复    2021-04-22 20:44:46 +08:00
    nieyujiang
        1
    nieyujiang  
       2021-04-20 08:13:51 +08:00 via iPhone
    也不说用的什么证书
    Apol1oBelvedere
        2
    Apol1oBelvedere  
    OP
       2021-04-20 19:52:00 +08:00
    @nieyujiang 如果是指 CodeSigner 的证书,我没有设置证书,该如何设置?如果是其他证书,我没有设置,能指导一下吗?
    nieyujiang
        3
    nieyujiang  
       2021-04-20 19:55:27 +08:00 via iPhone
    想要签名给其他机器用,需要用 developer id 证书,付费的,签名以后公证,不然各种问题
    Apol1oBelvedere
        4
    Apol1oBelvedere  
    OP
       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
        5
    Apol1oBelvedere  
    OP
       2021-04-21 22:32:33 +08:00
    @nieyujiang 目前再次进行了探索,推测可能是宿主机的 Intel x86 CPU 不能被虚拟机转换为 App 能识别和使用的类型。有什么办法完全模拟 mac 的 CPU ?
    nieyujiang
        6
    nieyujiang  
       2021-04-21 23:16:03 +08:00 via iPhone
    报错信息看看有没有 reason 之类的关键词,这就是切入点,没有就看异常类型
    Apol1oBelvedere
        7
    Apol1oBelvedere  
    OP
       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
        8
    Apol1oBelvedere  
    OP
       2021-04-22 20:44:46 +08:00
    @nieyujiang 搜索资料可能是引用 NULL 指针引起的 crash 日志,有误办法绕过或修复引用 NULL 指针错误?
    ---因为这个软件在 macbook 上直接秒运行无任何问题。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4751 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:42 · PVG 17:42 · LAX 02:42 · JFK 05:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.