Skip to content

Latest commit

 

History

History
51 lines (42 loc) · 1.13 KB

env.md

File metadata and controls

51 lines (42 loc) · 1.13 KB

安装Rustup

curl https://sh.rustup.rs -sSf | sh

Android:

targes

rustup target add aarch64-linux-android arm-linux-androideabi armv7-linux-androideabi i686-linux-android x86_64-linux-android

NDK and SDK

brew install coreutils
brew install openjdk@11
brew install android-ndk
brew install android-studio

For Non-Macos system: https://developer.android.google.cn/ndk/downloads

Environment

export ANDROID_NDK_ROOT=/usr/local/share/android-ndk
export ANDROID_SDK_ROOT=/Users/{username}/Library/Android/sdk
export JAVA_HOME=/usr/local/opt/openjdk@11
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH

Test if env is ok.

Create a new project: cargo new my_project --lib Try build:cargo rustc --target arm-linux-androideabi

iOS:

targets

rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios i386-apple-ios x86_64-apple-ios

cargo-lipo

cargo install cargo-lipo

XCode

xcode-select --install
xcode-select -s /Applications/Xcode.app/Contents/Developer
xcrun --show-sdk-path -sdk iphoneos