Mac に静的ライブラリがあり、そのライブラリが armV7s アーキテクチャ用に構築されているかどうか知りたいですか? このライブラリでサポートされているアーキテクチャを表示するために利用できるコマンド/ツールはありますか?
ありがとう、カムラン
Mac に静的ライブラリがあり、そのライブラリが armV7s アーキテクチャ用に構築されているかどうか知りたいですか? このライブラリでサポートされているアーキテクチャを表示するために利用できるコマンド/ツールはありますか?
ありがとう、カムラン
your-mac:~ yourlogin$ file /Path/to/somebinary
/Path/to/somebinary: Mach-O universal binary with 3 architectures
/Path/to/somebinary (for architecture x86_64): Mach-O 64-bit executable x86_64
/Path/to/somebinary (for architecture i386): Mach-O executable i386
/Path/to/somebinary (for architecture ppc7400): Mach-O executable ppc
その情報を取得するには、otool を使用できます。
otoolのマンページから
-L オブジェクトファイルが使用する共有ライブラリの名前とバージョン番号を表示します。ファイルが共有ライブラリの場合は、共有ライブラリ ID と同様。
例
> otool -L libRaptureXML_universal.a
Archive : libRaptureXML_universal.a (architecture armv7)
libRaptureXML_universal.a(RXMLElement.o) (architecture armv7):
Archive : libRaptureXML_universal.a (architecture i386)
libRaptureXML_universal.a(RXMLElement.o) (architecture i386):
他の回答に異論はありませんが、もう 1 つのオプションがありますlipo
。コマンドを使用します。
lipo -info
実行可能ファイルまたはライブラリで実行できます。いくつかの例:
minime:arc username$ lipo -info libarclite_iphonesimulator.a
input file libarclite_iphonesimulator.a is not a fat file
Non-fat file: libarclite_iphonesimulator.a is architecture: i386
minime:iPhone username$ cd HelloWorld.app/
minime:HelloWorld.app username$ lipo -info HelloWorld
Non-fat file: HelloWorld is architecture: armv7