I have a rooted Nexus 7 Jelly Bean tablet and whenever I attempt to run an application from a terminal emulator app after chmod 777ing it and using the syntax ("./applicationName") it insists that I do not have permission to execute even though I granted my self superUser privs using ("su"). After that I did a little research and I learnt that if you copy the file to the (/data/local/temp/) directory you should be able to execute the application. So when I tried that it said that the file does not exist even though it shows up when listing the directory contents using ("ls")

I have no idea what steps to take, if it helps I am tried to run (scp) as a test but I wish to be able to run a custom compiled version of dns2tcp. I know I could have used better applications such as a hello world compiled natively onthe device but i couldnt get my hands on a C compiler for android such as gcc.

Thanks for any advice

closed as off-topic by Matthew Read Oct 13 '15 at 17:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about writing and publishing Android apps, writing custom ROMs, and other topics that are primarily of concern to developers are off-topic. Consider taking advantage of other resources that may be appropriate for your question." – Matthew Read
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    can you add a little transcript of what you did? /sdcard is mounted with the 'noexec' feature which prevents executables from being run, by the way. Did you specify the full path with the second try (/data/local/tmp/yourprogram)? – ce4 Aug 20 '12 at 7:29
  • @ce4 I have tried what you have mentioned in the second part of your comment. Heres the transcript: pastebin.com/RkuMHuBj EDIT: Yea I forgot to press shift+enter :) my bad hehe – Andrei0427 Aug 20 '12 at 7:40
  • Did you try specifying the complete path for execution -- e.g. /data/local/tmp/scp? And made sure your scp file has no file extension when called without any? – Izzy Aug 20 '12 at 7:56
  • @Izzy I have, yes. Can anyone here run custom C applications from the terminal itself on an android device? – Andrei0427 Aug 20 '12 at 8:00
  • If the app isn't compiled for Android, it isn't going to work. – Matthew Read Oct 13 '15 at 17:23

try putting sh in front of your command, eg.:

sh ./scp


sh -c ./scp
  • I have received a syntax error when running the application, I'm guessing it happened because it wasn't compiled for the tablet itself because I ripped it off my phone. Alas, this must mean it worked.. right? – Andrei0427 Aug 29 '12 at 7:15
  • what error did you received? – EsOsO Aug 30 '12 at 7:19
  • the first command will definitely not work (./scp is not in a format that can be interpreted by the shell), the second is overkill (it just runs ./scp in a subshell). Both will not fix inappropriate execute permissions and/or other incompatibilities. – ce4 Sep 13 '12 at 18:10

Emulator app should be able to run another app from its own directory. That directory is called something like /data/data/com.super.emulator. Try giving the full path to the app you want in emulator.

If you want to get a compiler for Android, you can use NDK. Easy to get, free to use.

Can't you also push your file to /system/bin via adb? I don't know if you get that permission when you root your device. But if that's the case, it should make your life much easier.


Most likely you can't run the program because of libraries on the device you ripped it from being missing from the device you copied it to.

Since your end goal is to compile a program and run it natively on the phone, might I suggest you use the Android NDK? The NDK documentation includes STANDALONE-TOOLCHAIN.HTML which explains how to cross-compile a native program to run on your Android device.


If you are rooted (I see you are), use the su command and then run your original script. If the problem is permissions, this should fix it. And if you are using a shell script, you can just add this line to it at the top. you might have to check your superSu settings (or whichever superuser app you have with root), and make sure your terminal emulator has root permissions.

If you are not rooted (or can't run as root for some reason), I suggest looking into how XBMC does it, as I believe it can run apps in user mode.

Good luck.

Not the answer you're looking for? Browse other questions tagged or ask your own question.