Developing Rust on Android


#1

I have a Bluetooth keyboard for my phone, and since I didn’t have my laptop with me, I was curious if I could set up a Rust dev environment on my phone. I have Android, so I installed Busybox and then installed Termux. I was able to get Rustup to download the installer and proceed past the error it gave about $HOME being different than expected. Installation however failed with:

info: syncing channel updates for 'stable-aarch64-linux-android'
info: latest update on 2017-11-23, rust version 1.22.1 (05e2e1c41 2017-11-22)
error: target not found: 'aarch64-linux-android'

Following the README instructions and downloading the aarch64-linux-android rustup-init executable and running that gave me the same error. So has anyone gotten a Rust dev environment set up on an Android device?


#2

There is also a issue requesting a host build for android (so it can be installed by rustup). You can use an unofficial package: https://wiki.termux.com/wiki/Package_Management#its-pointless_.28live_the_dream.29


#3

Thanks, @marlbarbo! I did end up finding Termux and got it working using instructions from a StackOverflow question. I had to remove the ~/.cargo location from my path after the failed rustup install in order to get it working.

Now I can build everything, which is pretty awesome! Now I’ll try to actually test serialport-rs with hardware on my phone.