简体   繁体   English

如何确定apk是32位还是64位

[英]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 应用程序可以在两者上运行。

Apps without JNI没有 JNI 的应用

If you're not using the JNI, your APK won't contain any .so files.如果您不使用 JNI,您的 APK 将不包含任何.so文件。

Apps with JNI带有 JNI 的应用程序

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.

相关问题 如何确保 Android APK 支持 32 位和 64 位? - How to Ensure Android APK supports 32-bit as well as 64-bit? 如何在发布 Apk 时在 Adob​​e Animate CC 2019 中包含 64 位和 32 位本机代码 - How to Include 64-bit and 32-bit native code in Adobe Animate CC 2019 While Publishing Apk Android JNI:与64位设备具有32位兼容性吗? - Android JNI: 32-bit compatability with 64-bit devices? 将 32 位 android 应用程序转换为 64 位应用程序 - Converting 32-bit android Applications to 64-bit Applications 在 64 位 android 上使用 32 位 jni 库 - Use 32-bit jni libraries on 64-bit android 如何制作同时支持 32 位和 64 位架构的 Android 应用程序? - How to make Android apps which support both 32-bit and 64-bit architecture? 如何在64位Android设备上使用32位本机库 - How to use 32-bit native libraries on 64-bit Android device 如何在我的应用程序中包含 64 位和 32 位本机代码 - How to Include 64-bit and 32-bit native code in my app 如何在Android棒棒糖中以编程方式知道应用程序的进程是32位还是64位? - How to know a process of an app is 32-bit or 64-bit programmatically in Android lollipop? 如何解决“以下APK或应用捆绑包可用于64位设备,但它们只有32位本机代码:XXX”? - How to solve “The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: XXX”?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM