Issue
A single .apk
file may contain NDK binaries targeting different architectures (eg. x86, x86-64, etc.). I suppose that, when installing on a given device, the corresponding binary is selected automatically dependening on the device architecture. However, since for instance 64-bit devices are often compatible with 32-bit software, I want to make sure that the corresponding binaries were installed.
EDIT:
- I mean a local installation for testing purposes.
- I know you can have different .apk
's, each for one specific architecture. Assume there is a single one containing all architecture targets.
Solution
Specify the ABI in the installation process:
You can explicitly specify the ABI when installing an app with adb install
by using the --abi
option.
For Aarch32:
adb install --abi armeabi-v7a <YOUR_APK_FILE>.apk
For Aarch64:
adb install --abi arm64-v8a <YOUR_APK_FILE>.apk
Check ABI of running process:
This may be considered as a Hack, but it works for me.
If you already installed the .apk
and don't want to reinstall it, you can check the names of the .so
files within the .apk
file of interest (f.e. using mc). In my case they are located under /lib/armeabi-v7a
and /lib/arm64-v8a
. Then you can run your application on the device (in my case Android Nougat on aarch64) and do:
cat /proc/<PID_OF_YOUR_RUNNING_APP>/maps | grep <NAME_OF_SO_FILE>
For a .apk installed with --abi armeabi-v7a
option, the pathname is:
/data/app/<APP_NAME>/lib/arm/<NAME_OF_SO_FILE>
with --abi arm64-v8a
option:
/data/app/<APP_NAME>/lib/arm64/<NAME_OF_SO_FILE>
Reference for the proc filesystem: http://man7.org/linux/man-pages/man5/proc.5.html
Answered By - maxnorbi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.