Android: Executing a program on adb shell -


i have created executable using "include $(build_executable)" command in android.mk . requirement execute above generated executable on abd shell.

i tried:

below c-code compiled using ndk-build command:

#include <stdio.h> int main() {     printf("\n\nhello world\n\n");     return 0; } 

following android.mk file contents:

local_path := $(call my-dir)  include $(clear_vars)  local_module    := helloexecutable local_src_files := hello.c include $(build_executable) 

when execute command ndk-build following file generated:

projectroot->libs->helloexecutable

my job execute above generated file on adb shell. first pushed file onto sdcard using following command:

adb push ~/projectroot->libs->helloexecutable /sdcard/

now switch adb shell using: $adb shell command(here i'm using emulator).

then change permissions as: chmod 777 /sdcard/helloexecutable

once above command executed, executing permissions helloexecutable file.

then change current working directory sdcard. i.e. cd /sdcard/

now when try execute above file following error:

# ./helloexecutable ./helloexecutable: permission denied 

to perform above i'm using emulator. can please tell reason above error??

i kindly request viewers address above problem. waiting answers. in advance.

check if sd card mounted noexec option. try copying file partition /data , execute there.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -