### Install xbuild CLI tool Source: https://github.com/rust-mobile/xbuild/blob/master/README.md This command installs the `xbuild` command-line interface tool using Rust's `cargo` package manager. It requires a Rust toolchain to be installed on the system to function correctly. ```Shell cargo install xbuild ``` -------------------------------- ### List connected devices with xbuild Source: https://github.com/rust-mobile/xbuild/blob/master/README.md This command uses `xbuild` to list all connected development devices, including the host machine, Android devices (via ADB), and iOS devices (via IMD). It provides details such as device type, architecture, and operating system version for each detected device. ```Shell x devices host Linux linux x64 Arch Linux 5.16.10-arch1-1 adb:16ee50bc FP4 android arm64 Android 11 (API 30) imd:55abbd4b70af4353bdea2595bbddcac4a2b7891a David’s iPhone ios arm64 iPhone OS 15.3.1 ``` -------------------------------- ### Build Rust project for a specific device using xbuild Source: https://github.com/rust-mobile/xbuild/blob/master/README.md This command initiates a build of the Rust project for a specified Android device, identified by its ADB identifier. The process involves fetching precompiled artifacts, compiling the Rust code, and finally packaging the application into an APK file for deployment. ```Shell x build --device adb:16ee50bc [1/3] Fetch precompiled artifacts info: component 'rust-std' for target 'aarch64-linux-android' is up to date [1/3] Fetch precompiled artifacts [72ms] [2/3] Build rust Finished dev [unoptimized + debuginfo] target(s) in 0.11s [2/3] Build rust [143ms] [3/3] Create apk [958ms] ``` -------------------------------- ### Diagnose xbuild environment and dependencies Source: https://github.com/rust-mobile/xbuild/blob/master/README.md The `x doctor` command provides a comprehensive diagnostic report of the development environment, checking for the presence and versions of essential external tools required by xbuild. This includes components like clang/llvm, the Rust toolchain, Android SDK tools (adb, javac, java, kotlin, gradle), iOS development tools (idevice_id, ideviceinfo, etc.), and Linux utilities (mksquashfs), aiding in troubleshooting missing dependencies. ```Shell x doctor --------------------clang/llvm toolchain-------------------- clang 14.0.6 /usr/bin/clang clang++ 14.0.6 /usr/bin/clang++ llvm-ar unknown /usr/bin/llvm-ar llvm-lib unknown /usr/bin/llvm-lib lld 14.0.6 /usr/bin/lld lld-link 14.0.6 /usr/bin/lld-link lldb 14.0.6 /usr/bin/lldb lldb-server unknown /usr/bin/lldb-server ----------------------------rust---------------------------- rustup 1.25.1 /usr/bin/rustup cargo 1.64.0 /usr/bin/cargo --------------------------android--------------------------- adb 1.0.41 /usr/bin/adb javac 11.0.17 /usr/bin/javac java 11.0.17 /usr/bin/java kotlin 1.7.20-release-201 /usr/bin/kotlin gradle 7.5.1 /usr/bin/gradle ----------------------------ios----------------------------- idevice_id 1.3.0-167-gb314f04 /usr/bin/idevice_id ideviceinfo 1.3.0-167-gb314f04 /usr/bin/ideviceinfo ideviceinstaller 1.1.1 /usr/bin/ideviceinstaller ideviceimagemounter 1.3.0-167-gb314f04 /usr/bin/ideviceimagemounter idevicedebug 1.3.0-167-gb314f04 /usr/bin/idevicedebug ---------------------------linux---------------------------- mksquashfs 4.5.1 /usr/bin/mksquashfs ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.