ios - 有没有办法在 M1 MacBook 上直接运行 iOS 二进制文件?
问题描述
由于 M1 MacBooks 可以直接运行 iOS 应用程序,我想知道是否有办法直接运行 iOS 二进制文件,而不是只能从 App Store 运行那些?
我正在使用没有 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
完整链接是https://googleprojectzero.blogspot.com/2021/05/fuzzing-ios-code-on-macos-at-native.html
推荐阅读
- java - JAVA,使法线数组具有顶点数组的长度(来自已解析的 OBJ 文件)
- pandas - 将垂直线添加到 pandas df.plot of timeseries
- c# - 如何使用 JSON.NET 将 POCO 列表序列化为字符串列表,以减小大小?
- bash - 递归使用grep时如何从结果中排除目录名称
- wso2 - 使用 LDAP 配置登录 WSO2 API Publisher 时出现问题
- powershell - Powershell 在远程计算机上查找 RAM 信息并将 Partnumbers 保存到不同的变量中
- go - 使用 go run code.go 执行 Go 程序以供实际使用是最佳实践吗?
- c# - 如何在 Kendo UI asp net MVC 中为 Null 类型设置默认值
- neo4j - 将节点标签从 id 更改为 name
- php - Laravel 6.2 身份验证错误:LoginController 不存在