Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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

share|improve this question
1  
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
    
Excuse my ignorance, my understanding is that every app that is run in Android will get a user Id. If that is true, the terminal emulator itself should be an app running with one particular ID. If it has to launch apps how it can assign IDs to those apps? Am I totally wrong or which part I am missing to see? –  Narayanan Aug 20 '12 at 7:49
    
@Andrei0427 from your last comment I take it you managed to solve your problem. May I suggest you answer your own question (with a few additional details), and accept your own answer? This would help the community to see there is a solution available, and even is the suggested "behavior" here. –  Izzy Aug 20 '12 at 7:50
    
@Izzy My problem hasn't yet been solved because the TerminalIDE application is outputting ("sh: ./scp: No such file or directory") instead of running the application. If I find the solution I will of course post it –  Andrei0427 Aug 20 '12 at 7:52

4 Answers 4

up vote 2 down vote accepted
+50

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

sh ./scp

or

sh -c ./scp
share|improve this answer
    
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

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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