我有一个应用程序在使用文件时报告它在 Mach-O 中有 2 个架构
iPad:~/map/MyApp.app root# file MyApp
MyApp: Mach-O fat file with 2 architectures
编辑 - 我也用 Xcode 的工具检查了这个
xcrun -sdk iphoneos lipo -info MyApp
Architectures in the fat file: MyApp are: armv7 arm64
当我使用 otool 定位架构时,我可以看到我有 2 个,一个 ARMv7(cpusubtype 9)和一个 ARM64(cpysubtype 0)
iPad:~/map/MyApp.app root# otool -arch all -Vh MyApp
MyApp (architecture cputype (12) cpusubtype (9)):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC ARM 9 0x00 EXECUTE 41 4760 NOUNDEFS DYLDLINK TWOLEVEL PIE
MyApp (architecture cputype (16777228) cpusubtype (0)):
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
MH_MAGIC_64 16777228 0 0x00 EXECUTE 41 5368 NOUNDEFS DYLDLINK TWOLEVEL PIE
但是,当我尝试使用 lipo 精简二进制文件时,出现以下错误
iPad:~/map/MyApp.app root# lipo -thin armv7 MyApp -output ~/map/myappv7
-sh: /usr/bin/lipo: Bad CPU type in executable
有什么想法为什么我想不出这个特定的二进制文件?当与 armv7 一起使用时,我确实更新了我的 lipo 二进制文件,说:没有这种类型的架构。