Google Test can't execute: Permission Denied

646 views
Skip to first unread message

Rafal Krol

unread,
Sep 15, 2014, 8:22:54 AM9/15/14
to andro...@googlegroups.com
Hi,
I was trying to run example descibed in android-ndk-r10\sources\third_party\googletest but when I was executing the shell on emulator I got such error: can't execute: Permission denied. I prepared sample as was described in README.txt file in the directory I described above.
I found in the net another example from web page: https://github.com/sfuku7/googletest_android_ndk-build.
I downloaded it to my disk, then I compiled using ndk-build as described then I push the file into emulator using such instruction:

$ ./adb.exe push googletest_android_ndk-build-master/sample/test_project/obj/local/armeabi/sample_code_test /data/local/tmp/
1377 KB/s (1365996 bytes in 0.968s)

then I executed:
$ ./adb.exe -e shell /data/local/tmp/sample_code_test
/system/bin/sh: /data/local/tmp/sample_code_test: can't execute: Permission denied

In both examples I got the same error. I do not know how to workaround it. As I am working with emulator I do not know how to check if /data/local/tmp/sample_code_test binary exists there.

adb devices show me such stuff:
$ ./adb.exe devices -l
List of devices attached
emulator-5554          device product:sdk model:sdk device:generic

The device is configured as armeabi v7a - Galaxy Nexus with android 4.2.2 ( with emulation option set to "Use Host GPU").

I will add that file I am loading sample_code_test has read permission for all groups
-rwxr-xr-x sample_code_test

Do you have an idea :) ?

Thanks



Rafal Krol

unread,
Sep 16, 2014, 3:49:33 AM9/16/14
to andro...@googlegroups.com
I resolved the issue.
Problem was in permission of files which were transfered to the emulator. After it was downladed permissions were changed to read and write only (without execute).
So I had to execute such command:

adb shell chmod 755 /path_to_file_on_Device/file_name


Reply all
Reply to author
Forward
0 new messages