๋ฌ์คํธ ๋ฐ์ด๋๋ฆฌ
๊ฐ๋จํ ์์ฉ ํ๋ก๊ทธ๋จ์ผ๋ก ์์ํด ๋ณด๊ฒ ์ต๋๋ค. AOSP ์ฒดํฌ์์์ ๋ฃจํธ์์ ๋ค์ ํ์ผ์ ์์ฑํฉ๋๋ค:
hello_rust/Android.bp:
rust_binary {
name: "hello_rust",
crate_name: "hello_rust",
srcs: ["src/main.rs"],
}
hello_rust/src/main.rs:
//! Rust demo. /// Prints a greeting to standard output. fn main() { println!("Hello from Rust!"); }
๊ทธ๋ฐ ๋ค์, ์ด ๋ฐ์ด๋๋ฆฌ๋ฅผ ๋น๋ํ๊ณ , ๊ฐ์ ๋๋ฐ์ด์ค์ ๋ฃ๊ณ , ์คํํฉ๋๋ค:
m hello_rust
adb push "$ANDROID_PRODUCT_OUT/system/bin/hello_rust /data/local/tmp"
adb shell /data/local/tmp/hello_rust
Hello from Rust!