I need to run a configure
file into my android phone so I think the best way to do this is to use the adb shell
command.
I'm running an Android emulator onto a Windows-7 platform, and there I'm running the adb shell
command into a DOS window. Using the cd
command I'm changing to the directory where my configure
file is, and then I'm executing the following command: ./configure
. I'm getting the following error :
./configure: permission denied
So I try to run adb in root mode with adb root
-- but apparently my adb is already in root mode (Moreover I have the "#" character before each line of my adb shell).
I have also tried to use chmod
but I don't see any difference before and after executing this command (ls -la
), so maybe the problem is here (How can I run the chmod
command?).
Maybe someone here can help me with my issue, and if you have also an explanation about why I don't have the permission to run my configure
file it will be great.
Thanks.
PS: My goal here is to use the net-snmp package on an Android platform by compiling the sources of this project directly onto the platform.
Answer
This is due to 2 things:
- The file does not have execute permissions [AND]
- The file cannot gain executable permissions as it is on the SD Card. The SD Card's filesystem can accept file permissions, however it is mounted with the
noexec
flag, as stated in a comment. This stops files being executed.
Solution:
- Copy the
net-snmp-5.7.2
directory to the/data/local/tmp
directory as root. - Set the
configure
file to be executable by runningchmod 0777 /data/local/tmp/net-snmp-5.7.2/configure
as root. - You should now be able to execute the configure script by typing
/data/local/tmp/net-snmp-5.7.2/configure
and pressing enter.
Note
This should all be done as the root user :)