Crates.io | cargo-so |
lib.rs | cargo-so |
version | 0.3.0 |
source | src |
created_at | 2022-01-21 09:55:02.038714 |
updated_at | 2024-11-06 05:57:06.888813 |
description | Helps cargo build Android .so lib files |
homepage | |
repository | https://github.com/jinleili/wgpu-in-app |
max_upload_size | |
id | 518444 |
size | 19,036 |
Tool for compile Rust package to Android .so
lib files.
Code modified from cargo-apk
cargo install --path .
Assuming your computer already has Android Studio installed, go to Android Studio
> Tools
> SDK Manager
> Android SDK
> SDK Tools
. Check the following options for installation and click OK.
Set two following environment variables:
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
# Replace the NDK version number with the version you installed
export NDK_HOME=$ANDROID_SDK_ROOT/ndk/28.0.12433566
Add build targets
rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android
Build
# build to all android targets
cargo so build --lib
# build to the specified target
cargo so b --lib --target aarch64-linux-android