Help us understand the problem. What is going on with this article?

静的バイナリファイルが64bit対応しているかチェックする

More than 5 years have passed since last update.

前置き

iOSでは2015/02から新規アプリの64bit対応が必須に、また2015/06からアップデートも64bit対応が必須になりました。

自分のコードだけで完結すればいいのですが、third partyのライブラリなどをつかっているとそのライブラリも64bit対応をする必要があります。

チェック方法

fileコマンドを用いるとチェックが可能です。

$ file libzbar.a
libzbar.a: Mach-O universal binary with 3 architectures
libzbar.a (for architecture armv7): current ar archive random library
libzbar.a (for architecture armv7s):    current ar archive random library
libzbar.a (for architecture arm64): current ar archive random library

iosの静的バイナリはいわゆる universal binaryとかfat binaryという形式で、複数のアーキテクチャのマシンコードが含まれています。
この中に arm64 が含まれているとそのライブラリは64bit対応がなされています。

$ file Crashlytics.framework/Crashlytics
Crashlytics.framework/Crashlytics: Mach-O universal binary with 5 architectures
Crashlytics.framework/Crashlytics (for architecture armv7): current ar archive random library
Crashlytics.framework/Crashlytics (for architecture armv7s):    current ar archive random library
Crashlytics.framework/Crashlytics (for architecture i386):  current ar archive random library
Crashlytics.framework/Crashlytics (for architecture x86_64):    current ar archive random library
Crashlytics.framework/Crashlytics (for architecture arm64): current ar archive random library

また*.frameworkなども中身にstatic binaryがふくまれているので、fileコマンドで同様に対応を確認することが可能です。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした