Cross-compile seekdb for Android arm64-v8a on macOS, then deploy it to an emulator or physical device.
- macOS host
- Android NDK 27.x, with
ANDROID_NDK_HOMEset when it is not installed at the default SDK path - An arm64-v8a device or emulator running API 28 or later
adband a MySQL-compatible client onPATH
Use the supported Android entry point. It initializes Android dependencies, configures the build, and builds seekdb:
./build.sh release --android --init --make -j16The binary is generated at:
build_android_release/src/observer/seekdb
The Android CMake build does not provide an all_tests target. Validate affected unit tests on a supported Linux host by following Write and run unit tests.
Use the NDK strip tool because the macOS strip command cannot process Android ELF binaries:
NDK_STRIP="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip"
"$NDK_STRIP" -o /tmp/seekdb build_android_release/src/observer/seekdb
adb push /tmp/seekdb /data/local/tmp/seekdb
adb shell chmod +x /data/local/tmp/seekdbFor an Apple Silicon NDK installation, use the actual prebuilt host directory present under $ANDROID_NDK_HOME/toolchains/llvm/prebuilt/.
Choose resource values that fit the device:
adb shell "mkdir -p /data/local/tmp/seekdb_data"
adb shell "/data/local/tmp/seekdb --nodaemon \
--base-dir /data/local/tmp/seekdb_data \
--parameter memory_budget=4G \
--parameter datafile_size=2G \
--parameter datafile_maxsize=4G \
--parameter log_disk_size=2G \
--log-level INFO"Forward the SQL port and connect:
adb forward tcp:2881 tcp:2881
mysql -h127.0.0.1 -P2881 -urootInspect logs and stop the process with:
adb shell "tail -100 /data/local/tmp/seekdb_data/log/seekdb.log"
adb shell "kill \$(pidof seekdb)"