I created an executable binary for arm64-v8a,armeabi-v7a,x86 and x86_64. But how can i choose which binary to run on a device?
Asked
Active
Viewed 157 times
1 Answers
0
I assume you mean you created a .so file for a library? If so, the device will choose the correct one to use when you load the library, based on the device's chipset. If you mean you built a linux executable program, then you only upload the appropriate type, as anything else will not run.

Gabe Sechan
- 90,003
- 9
- 87
- 127
-
no not a .so but to a executable binary which can be executed from terminal emulator. – NoNoob Mar 01 '18 at 14:50
-
1Then you want to upload only the appropriate one- there is no magic that will choose the correct one for you. Figure out what type of processor the device has and use it. Pretty much every device in the world is ARM, so ignore the x86. v7a will run on a v8a device, so start with that one unless you need v8a instructions for performance. – Gabe Sechan Mar 01 '18 at 14:50
-
No i dont want to upload the appropriate one ,i am having all the binaries in assets folder and now i want to use the appropriate one. – NoNoob Mar 01 '18 at 14:53
-
You can upload any number you want, its just wasting space. The x86 ones will only be used on simulators and <1% of devices. For everything else just run the arm 7v, since v8 is backwards compatible. In fact you may as well not include the others. – Gabe Sechan Mar 01 '18 at 14:55
-
v7a is not running on my v8a device,Only v8a is working. – NoNoob Mar 01 '18 at 14:56
-
You can use Build.SUPPORTED_ABIS to get a list of ABIs the device supports – Gabe Sechan Mar 01 '18 at 14:59
-
sorry my bad,v7a is working on v8a,i was setting the cMake PIE arguments from Android.mk(which is wrong), when i set the correct parameters from gradle it worked. @Gabe Sechan You were damm right,I love you. :) – NoNoob Mar 01 '18 at 21:39