gpt4 book ai didi

ios - 如何确定 iOS 中静态库的特定切片的大小

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:01:52 25 4
gpt4 key购买 nike

我的 iOS 项目中有一个静态库,其中包含 4 种架构的切片。我可以使用以下命令确定静态库的架构切片组件:

$ file myStaticLib.a
myStaticLib.a: Mach-O universal binary with 4 architectures
myStaticLib.a (for architecture armv7): current ar archive random library
myStaticLib.a (for architecture i386): current ar archive random library
myStaticLib.a (for architecture x86_64): current ar archive random library
myStaticLib.a (for architecture arm64): current ar archive random library

我想确定特定切片(例如 arm64)的大小。我该怎么做?

最佳答案

使用带有 -detailed_info 标志的 lipo 命令,您可以确定特定切片的大小(以及其他详细信息)。用法如下:

$ lipo -detailed_info myStaticLibrary.a

Fat header in: myStaticLib.a
fat_magic 0xcafebabe
nfat_arch 4
architecture armv7
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7
offset .......
size .......
align 2^2 (4)
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset .......
size .......
align 2^2 (4)
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset .......
size .......
align 2^2 (4)
architecture arm64
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
offset .......
size .......
align 2^2 (4)

关于ios - 如何确定 iOS 中静态库的特定切片的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29091757/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com