Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to execute with Termux on Android #111

Open
crazydude11 opened this issue Aug 6, 2020 · 10 comments
Open

Trying to execute with Termux on Android #111

crazydude11 opened this issue Aug 6, 2020 · 10 comments

Comments

@crazydude11
Copy link

crazydude11 commented Aug 6, 2020

So far ive figured out how to navigate through linux (lol) and actually find where phantom is in my downloads and stuff. However when I try to start the server ($ cd /storage/emualated/0/download/phantom-master -server 104.238.130.180) i get the error "bash: cd: too many arguments". I know I'm clueless lmfao but I really need some help guys. Ill leave a screenshot. Thanks guys
Screenshot_2020-08-06-06-50-50-1

@crazydude11
Copy link
Author

Somebody help pls

@crazydude11
Copy link
Author

Update: I was able to figure out how to add execute permissions now i need to figure out what I have to say to actually get it to execute.
Screenshot_2020-08-06-09-34-09-1

@crazydude11
Copy link
Author

Update
Screenshot_2020-08-06-11-59-15-1

@joshuaxlino
Copy link

Update

Screenshot_2020-08-06-11-59-15-1

chmod u+x ./phantom-linux

@carchrae
Copy link

i was actually just wondering about this. it would be awfully convenient if there was an android build, ideally in the play store. chances are you need to set your android device to stay awake and some other junk for it to be useful/non-frustrating.

@joshuaxlino - not clear, but you may be getting the error if (a) it isn't the right architecture (maybe one of the arm builds would work - try uname -m to determine your OS architecture. (b) perhaps the device isn't rooted and so doesn't allow execution outside the normal paths.

actually looking at https://wiki.termux.com/wiki/Differences_from_Linux it seems you might need to actually build it in termux. here is another rabbit hole to climb into! :D http://rafalgolarz.com/blog/2017/01/15/running_golang_on_android/ (maybe there is a better/newer idea on go in android - phantom is written in go)

@joshuaxlino
Copy link

i was actually just wondering about this. it would be awfully convenient if there was an android build, ideally in the play store. chances are you need to set your android device to stay awake and some other junk for it to be useful/non-frustrating.

@joshuaxlino - not clear, but you may be getting the error if (a) it isn't the right architecture (maybe one of the arm builds would work - try uname -m to determine your OS architecture. (b) perhaps the device isn't rooted and so doesn't allow execution outside the normal paths.

actually looking at https://wiki.termux.com/wiki/Differences_from_Linux it seems you might need to actually build it in termux. here is another rabbit hole to climb into! :D http://rafalgolarz.com/blog/2017/01/15/running_golang_on_android/ (maybe there is a better/newer idea on go in android - phantom is written in go)

My bad bro, mine had that error but was fixed right after entering the command line. That may also have to do with the fact i am using alpine shell on ios.

@carchrae
Copy link

carchrae commented Aug 11, 2020

My bad bro, mine had that error but was fixed right after entering the command line. That may also have to do with the fact i am using alpine shell on ios.

do you mean you got it working on android? or just on ios, which should work fine.

i looked a little deeper, and basically i think you need a specific build for android. i tried to build on my desktop machine, but no luck yet.

(added this to Makefile)

bin/phantom-android-arm64:
	pushd cmd && \
	GOOS=android GOARCH=arm64 go build -o ../bin/phantom-android-arm64 ${CMDSRC} && \
	popd

returns

/usr/lib/go-1.14/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-016417761/go.o: Relocations in generic ELF (EM: 183)
/tmp/go-link-016417761/go.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

so, i googled a bit, and then tried with CGO_ENABLED=1 but alas, still no joy

bin/phantom-android-arm64:
	pushd cmd && \
	CGO_ENABLED=1 GOOS=android GOARCH=arm64 go build -o ../bin/phantom-android-arm64 ${CMDSRC} && \
	popd
# runtime/cgo
gcc_android.c:6:10: fatal error: android/log.h: No such file or directory
 #include <android/log.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
Makefile:50: recipe for target 'bin/phantom-android-arm64' failed

feels close tho...

@joshuaxlino
Copy link

I didn't manage to get far with many errors but for the "permission denied" i provided my fix. Btw, i suggest trying "bedrockconnect". It is another server related build but there are key differences. It is built in java as a .jar so you only need to run the jar in java via a command line. As an ios user, phantom was my only hope but i think its possible and probably easier for this alternative.

@crazydude11
Copy link
Author

Thanks guys ! This is some pretty helpful stuff. Hopefully somebody will program phantom into an app one day and keep it free .

@BadWolf22
Copy link

The build you require to run in Termux is the phantom-linux-arm5 build. You simply have to download it move it to a location within Termux where scripts are executable, add executable permission, and finally run the start command ("./phantom-linux-arm5 -server ...").

I have instructions on how to run Phantom on Termux here if you would like step by step instructions.

It also looks like maybe you are using iSH on iOS? This was more difficult to get working and you can find the solution I found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants