Skip to content

Agent Mesh

docs: mobile-ffi targets do not copy into jniLibs; fix x86_64 paths

Tomas Tormo0f7ad15f1822
diff --git a/mobile/sam-node-app/README.md b/mobile/sam-node-app/README.md
index 3af03812..94175c2f 100644
--- a/mobile/sam-node-app/README.md
+++ b/mobile/sam-node-app/README.md
@@ -26,19 +26,21 @@ To build the app, you must first compile the Go FFI library and bundle it inside
### 1. Compile FFI Library
-Run one of the following commands from the **repository root directory**:
+Run one of the following from the **repository root directory**. The `mobile-ffi-*` targets only build into `bin/`; the `cp` step puts the library where the Flutter project loads it from. (`make mobile-app-apk` and `make mobile-app-apk-emulator` do build, copy and release APK in one go.)
-* **For Android ARM64 Devices (Physical Phones)**:
+* **For Android ARM64 (physical phones, and emulators on Apple Silicon hosts)**:
```bash
make mobile-ffi-android
+ mkdir -p mobile/sam-node-app/android/app/src/main/jniLibs/arm64-v8a
+ cp bin/android/libsam.so mobile/sam-node-app/android/app/src/main/jniLibs/arm64-v8a/
```
- *Copies the binary to `mobile/sam-node-app/android/app/src/main/jniLibs/arm64-v8a/libsam.so`*
-* **For Android x86_64 Emulators (AVD)**:
+* **For Android x86_64 emulators (Intel and Linux hosts)**:
```bash
make mobile-ffi-android-x86_64
+ mkdir -p mobile/sam-node-app/android/app/src/main/jniLibs/x86_64
+ cp bin/android-x86_64/libsam.so mobile/sam-node-app/android/app/src/main/jniLibs/x86_64/
```
- *Copies the binary to `mobile/sam-node-app/android/app/src/main/jniLibs/x86_64/libsam.so`*
* **For iOS Devices**:
```bash
diff --git a/site/content/docs/development/mobile.md b/site/content/docs/development/mobile.md
index 0c9759be..8b451fae 100644
--- a/site/content/docs/development/mobile.md
+++ b/site/content/docs/development/mobile.md
@@ -65,7 +65,7 @@ make mobile-ffi-android
```
### 3. Build Android Emulator FFI Library
-Compiles `bin/android/libsam.so` targeting Android x86_64 emulator environments:
+Compiles `bin/android-x86_64/libsam.so` for x86_64 emulator images (Intel and Linux hosts). Emulators on Apple Silicon run arm64-v8a images; use target 2 for those:
```bash
make mobile-ffi-android-x86_64
```
@@ -89,6 +89,8 @@ make mobile-app-apk
To make changes to `sam-node` and run them on a mobile device:
### Android Setup
+The `mobile-ffi-*` targets only build into `bin/`; copy the library into `jniLibs/` yourself (or use `make mobile-app-apk`, which does both and builds the APK). For an x86_64 emulator, swap in `mobile-ffi-android-x86_64`, `bin/android-x86_64/libsam.so` and `jniLibs/x86_64`.
+
1. Compile the Android ARM64 FFI shared library:
```bash
make mobile-ffi-android