<p>Hi Gophers, I recently installed Termux on an android phone (and a whole ecosystem Droid Edit, Amaze, etc...) to try to have my Go development on mobile. I did <strong>apt install golang</strong> with no issues, installed git too, setup my $GOPATH in shared space and all. I could even go get some packages like Bolt and Echo correctly. Then I tried a simple hello.go (simple fmt.Println) and it works via <strong>go run hello.go</strong>, after that I naturally ran <strong>go build</strong> on the hello program and compiles perfectly with no issues. But when I try to run the compiled binary I get the error <strong>can't execute: Permission Denied</strong>. Which was... expected... so I replicated the procedure on a rooted android device, used su inside Termux give root permissions to the terminal (SuperSu prompted), but I keep getting the same error no matter what I do.</p>
<p>Does anyone here know what I'm missing? Thanks for your input.</p>
<hr/>**评论:**<br/><br/>ar1819: <pre><p>I had no trouble when my GOPATH was in my home directory, so maybe running things from shared space cause this? go run works differently, by creating temp directory inside /tmp and launching compiled binary from there, IIRC. </p>
<p>Edit: hope -> home</p></pre>guesdo: <pre><p>Thanks for the reply! That did it! If I set my GOPATH or write my code inside $HOME but not the shared space, it compiles and runs correctly. I guess Android has safe guards to prevent execution from anything in the shared user space. Now my problem is that I can't use my code editor and file manager in Termux data space without root access.</p></pre>loafoe: <pre><p>My WoW is using VIM inside Termux. Furthermore all code is stored in GIT, so it's pretty easy to ship code in and out of the termux environment e.g. you can do your editting on another device.</p></pre>
