Rust nightly for android

is exists a edition nightly build for android?

1 Like

The Conditional Compilation section of The Rust Reference describes how to prepare compiler-defined configuration options to achieve compiler output for an Android build target operating system with #[cfg(target_os = "android")].

Servo by Mozilla Research is built on Rust. They have shared preliminary cross-build instructions of Servo for Android here.

Unfortunately, there's no official nightly builds for android (yet...). Some community members have published regular builds for android at various points in the past, but I forget who and I'm unsure if they are continuing to do so.

that's what I'm doing:
build rust for android:
export NDK_ROOT=~/android/android-ndk-r9d/
$NDK_ROOT/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/opt/ndk_standalone --system=linux-x86_64
export PATH=/opt/ndk_standalone/bin:$PATH
export RUST_ROOT=~/rust4android
sudo ./configure --target=arm-linux-androideabi --prefix=$RUST_ROOT && make -j8 && make install

compile
export LD_LIBRARY_PATH=$RUST_ROOT/lib:$LD_LIBRARY_PATH
$RUST_ROOT/bin/rustc --target=arm-linux-androideabi -C linker=arm-linux-androideabi-g++ ./src/test/run-pass/hello.rs

1 Like