First, you have to push it into a directory, such as
/data/local/tmp. Then, you have to set permission for that using
chmod 755 executable. After that, you can run it as
Complete steps are as follows:
adb push executable /data/local/tmp
chmod 755 executable
Alternatively, if you want to run it from your asset folder, you have to copy the file to your data folder
/data/data/packagename/. Then using
File class, set the
setExecutable flag to
true for the file and run it by the Process class or third party packages like Root Tools .
if you are targeting sdk 29 or higher you CANNOT use the binary from your asset folder ! you have to copy your binary to jnilib folder then run it from native library directory !