首页 > 解决方案 > 有没有办法在 M1 MacBook 上直接运行 iOS 二进制文件?

问题描述

由于 M1 MacBooks 可以直接运行 iOS 应用程序,我想知道是否有办法直接运行 iOS 二进制文件,而不是只能从 App Store 运行那些?

我正在使用没有 Xcode 的 C 开发 iOS 应用程序,我目前的工作流程是:

它工作得很好,但如果我能以某种方式直接运行构建的二进制文件,那就太好了,如果我直接运行它只是说

% 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

但我不知道这些是否有助于它可以运行,并且找不到关于这些的文档

标签: iosmacosmacos-big-surapple-m1apple-silicon

解决方案


是的,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

完整链接是https://googleprojectzero.blogspot.com/2021/05/fuzzing-ios-code-on-macos-at-native.html


推荐阅读