[Command] 라이브러리 파일 정보 확인

2016. 9. 26. 16:48컴퓨터 잘쓰기/Mac(OSX)


반응형

# Architectures 확인 명령

> xcrun -sdk iphoneos lipo -info lib.a 

Architectures in the fat file: lib.a are: armv7 arm64
> file lib.a 

lib.a: Mach-O universal binary with 2 architectures
lib.a (for architecture armv7): current ar archive random library
lib.a (for architecture arm64): current ar archive random library
> lipo -info lib.a 

Architectures in the fat file: lib.a are: armv7 arm64

# 라이브러리 내부에 포함된 Obj 파일 Architectures 확인 명령

> otool -hv /sw/lib/libfftw3.a

Archive : /sw/lib/libfftw3.a
/sw/lib/libfftw3.a(align.o):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00      OBJECT     3        336 SUBSECTIONS_VIA_SYMBOLS
/sw/lib/libfftw3.a(alloc.o):
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64  X86_64        ALL  0x00      OBJECT     3        416 SUBSECTIONS_VIA_SYMBOLS
...

 

# 라이브러리 심볼 확인

> nm -um /System/Applications/Calculator.app/Contents/MacOS/Calculator

(undefined) external _CFRelease (from CoreFoundation)
(undefined) external _CFUUIDCreate (from CoreFoundation)
(undefined) external _CGRectGetWidth (from CoreGraphics)
(undefined) external _CalculateExpression (from Calculate)
(undefined) external _NSAccessibilityHelpAttribute (from AppKit)
(undefined) external _NSApp (from AppKit)
(undefined) external _NSAppearanceNameTouchBar (from AppKit)
(undefined) external _NSAppearanceNameVibrantDark (from AppKit)
(undefined) external _NSApplicationMain (from AppKit)
(undefined) external _NSBeep (from AppKit)
(undefined) external _NSClassFromString (from Foundation)
(undefined) external _NSFontAttributeName (from AppKit)
(undefined) external _NSFontFeatureSelectorIdentifierKey (from AppKit)
(undefined) external _NSFontFeatureSettingsAttribute (from AppKit)
...
반응형