有没有办法在M1 MacBooks上直接运行iOS二进制文件?

有没有办法在M1 MacBooks上直接运行iOS二进制文件?,ios,macos,macos-big-sur,apple-m1,apple-silicon,Ios,Macos,Macos Big Sur,Apple M1,Apple Silicon,既然M1 MacBooks可以直接运行iOS应用程序,我想知道是否有一种方法可以直接运行iOS二进制文件,而不是只能从应用商店运行这些应用程序 我正在使用不带Xcode的C开发iOS应用程序,我当前的工作流程是: 使用xcrun-sdk iphonesimulator clang构建 打包到iOS.app捆绑包中 使用xcrun simctl命令复制并在模拟器上运行 它工作得很好,但是如果我可以直接运行构建的二进制文件,那就太好了,如果我直接运行它,它只是说 % file app app:

既然M1 MacBooks可以直接运行iOS应用程序,我想知道是否有一种方法可以直接运行iOS二进制文件,而不是只能从应用商店运行这些应用程序

我正在使用不带Xcode的C开发iOS应用程序,我当前的工作流程是:

  • 使用
    xcrun-sdk iphonesimulator clang构建
  • 打包到iOS
    .app
    捆绑包中
  • 使用
    xcrun simctl
    命令复制并在模拟器上运行
它工作得很好,但是如果我可以直接运行构建的二进制文件,那就太好了,如果我直接运行它,它只是说

% file app
app: Mach-O universal binary with 2 architectures: [arm_v7:Mach-O executable arm_v7] [arm64:Mach-O 64-bit executable arm64]
app (for architecture armv7):   Mach-O executable arm_v7
app (for architecture arm64):   Mach-O 64-bit executable arm64

% ./app
zsh: killed     ./app
我真的不知道是怎么回事

app Store中可运行的iOS
.app
似乎具有以下结构:

iOSapp.app
├── WrappedBundle -> Wrapper/iOSapp.app
└── Wrapper
    ├── BundleMetadata.plist
    ├── iTunesMetadata.plist
    └── iOSapp.app

但我不知道这些是否有助于它的运行,也无法在这些上找到文档是的,Google P0刚刚找到了一种方法:

因此,在macOS上启动iOS二进制文件所需的完整步骤包括:

Use the posix_spawnattr_set_platform_np API to set the target platform to PLATFORM_IOS

Execute the new process via posix_spawn(2) and start it suspended

Patch dyld to allow library interposing

In the interposed library, claim to possess the com.apple.security.cs.debugger entitlement by replacing xpc_copy_entitlements_for_self

Continue the process by sending it SIGCONT
完整链接是