[英]How to find if apk is 32-bit or 64-bit
Given a APK, how can we find whether its a 32-bit app or a 64-bit app?给定一个 APK,我们如何确定它是 32 位应用程序还是 64 位应用程序? I am observing an app is unable to run on 64-bit android OS.
我观察到一个应用程序无法在 64 位安卓操作系统上运行。 I guess its a 32-bit app.
我猜它是一个 32 位应用程序。
APK is ZIP. APK 是 ZIP。 You can open it and check directory
lib
to see which architectures are supported.您可以打开它并检查目录
lib
以查看支持哪些架构。 If there is no directory lib
, it supports all architectures.如果没有目录
lib
,则它支持所有架构。
64-bit Android is backwards compatible and can run 32-bit applications. 64 位 Android 向后兼容,可以运行 32 位应用程序。 On the other hand, Intel Android (both 32-bit and 64-bit) has very limited compatibility with ARM Android (a binary translator called
libhoudini
is shipped on Intel but from my experience, it works for only very simple code), and ARM Android is completely incompatible with Intel Android.另一方面,英特尔 Android(32 位和 64 位)与 ARM Android 的兼容性非常有限(英特尔提供了一个名为
libhoudini
的二进制转换器,但根据我的经验,它只适用于非常简单的代码),而 ARM Android 与英特尔 Android 完全不兼容。 This affects only applications with NDK code in lib
, pure Java applications can be run on both.这仅影响
lib
包含 NDK 代码的应用程序,纯 Java 应用程序可以在两者上运行。
If you're not using the JNI, your APK won't contain any .so
files.如果您不使用 JNI,您的 APK 将不包含任何
.so
文件。
Unzip the APK, eg unzip tensorflow-lite.aar -d tensorflow-lite
解压 APK,例如
unzip tensorflow-lite.aar -d tensorflow-lite
Look inside /jni
, and observe the directories inside it:查看
/jni
内部,并观察其中的目录:
It looks like the APK/ AAR I unzipped contains .so
files for all 4 JNI ABI's.看起来我解压的 APK/AAR 包含所有 4 个 JNI ABI 的
.so
文件。 This is good, because I built the tensorflow lite library for all platforms.这很好,因为我为所有平台构建了 tensorflow lite 库。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.