# Connect an Android phone to Manina AI: setup guide for AI assistants

> You are helping a person connect their Android phone to Manina AI, either the web Playground (https://manina.ai/llm#playground) or the `manina` command line. Run the computer-side commands yourself. Some steps can only be done by the person, on the phone; they are marked **[person]**. Ask for one at a time, say exactly what to tap, and wait until they say it is done. Reply in the person's language.

## What you need

- An Android phone and a USB **data** cable (some charging cables carry no data: if the phone never shows up, try another cable or port).
- A computer. The web Playground needs desktop **Chrome or Edge** (it talks to the phone over WebUSB). The `manina` CLI runs on macOS and Linux.
- Nothing to install on the phone, except the optional keyboard in step 5.

## 1. Check adb on the computer

Run `adb version`. If it is missing, install Android platform-tools:

- macOS: `brew install --cask android-platform-tools`
- Windows: `winget install Google.PlatformTools`, or download https://developer.android.com/tools/releases/platform-tools and add the folder to PATH.
- Linux: `sudo apt install adb` (Debian/Ubuntu), `sudo dnf install android-tools` (Fedora), `sudo pacman -S android-tools` (Arch).

The browser Playground itself does not need adb, but adb is the quickest way to check the phone is set up right.

## 2. Turn on Developer options [person]

Ask for the phone brand, then give that brand's path. If they can't find it, they can search Settings for "Build number" or "Developer options" (中文：「版本号」或「开发者选项」).

- **Xiaomi / Redmi / POCO** (小米 / Redmi / POCO): Settings › About phone › tap “OS version” (or “MIUI version”) 7 times.
  - 中文菜单：设置 › 我的设备（关于手机）› 连点「OS 版本」（或「MIUI 版本」）7 次。
- **Samsung** (三星): Settings › About phone › Software information › tap “Build number” 7 times.
  - 中文菜单：设置 › 关于手机 › 软件信息 › 连点「编译编号」7 次。
- **Huawei / Honor** (华为 / 荣耀): Settings › About phone › tap “Build number” 7 times.
  - 中文菜单：设置 › 关于手机 › 连点「版本号」7 次。
- **OPPO / OnePlus / realme** (OPPO / 一加 / realme): Settings › About device › Version › tap “Build number” 7 times.
  - 中文菜单：设置 › 关于手机 › 版本信息 › 连点「版本号」7 次。
- **vivo / iQOO** (vivo / iQOO): Settings › System management › About phone › tap “Software version” 7 times.
  - 中文菜单：设置 › 系统管理 › 关于手机 › 连点「软件版本号」7 次。
- **Pixel / other** (Pixel / 其他): Settings › About phone › tap “Build number” 7 times.
  - 中文菜单：设置 › 关于手机 › 连点「版本号」7 次。

## 3. Turn on USB debugging [person]

- **Xiaomi / Redmi / POCO** (小米 / Redmi / POCO): Settings › Additional settings › Developer options: turn on “USB debugging” and “USB debugging (Security settings)”. The second needs a SIM card and a signed-in Mi account; without it Manina sees the screen but can’t tap.
  - 中文菜单：设置 › 更多设置 › 开发者选项：打开「USB 调试」和「USB 调试（安全设置）」。后者需要插着 SIM 卡并登录小米账号；不打开的话 Manina 能看到屏幕，但点不了。
- **Samsung** (三星): Settings › Developer options (at the bottom): turn on “USB debugging”.
  - 中文菜单：设置 › 开发者选项（在最下面）：打开「USB 调试」。
- **Huawei / Honor** (华为 / 荣耀): Settings › System & updates › Developer options: turn on “USB debugging”. If the phone asks how to use USB, pick “Transfer files”.
  - 中文菜单：设置 › 系统和更新 › 开发人员选项：打开「USB 调试」。插线后手机问 USB 用途时，选「传输文件」。
- **OPPO / OnePlus / realme** (OPPO / 一加 / realme): Settings › Additional settings › Developer options: turn on “USB debugging”. If taps don’t land, also turn on “Disable permission monitoring”.
  - 中文菜单：设置 › 其他设置 › 开发者选项：打开「USB 调试」。如果点不动，再打开「禁止权限监控」。
- **vivo / iQOO** (vivo / iQOO): Settings › System management › Developer options: turn on “USB debugging”.
  - 中文菜单：设置 › 系统管理 › 开发者选项：打开「USB 调试」。
- **Pixel / other** (Pixel / 其他): Settings › System › Developer options: turn on “USB debugging”.
  - 中文菜单：设置 › 系统 › 开发者选项：打开「USB 调试」。

Xiaomi / Redmi / POCO: "USB debugging (Security settings)" needs a SIM card in the phone and a signed-in Mi account. Without it Manina can see the screen but every tap is blocked. OPPO / OnePlus / realme: if taps don't land later, turn on "Disable permission monitoring" (「禁止权限监控」).

## 4. Plug in, unlock, allow [person]

1. Plug the phone into the computer with the data cable and unlock it.
2. Run `adb devices`. The phone shows a prompt "Allow USB debugging?": the person taps **Allow** and ticks **Always allow from this computer** (「一律允许使用这台计算机进行调试」).
3. Run `adb devices` again. Done when the phone's line ends in `device`.
   - `unauthorized`: the prompt was not accepted. Unlock the phone and look for it; if it never appears, Developer options › "Revoke USB debugging authorizations" (「撤销 USB 调试授权」), replug, try again.
   - Empty list: USB debugging is off, the cable carries no data, or (Huawei / Honor) the phone asks how to use USB: pick "Transfer files" (「传输文件」).
4. Optional check that taps are allowed: `adb shell input keyevent KEYCODE_WAKEUP` should succeed. An error mentioning `INJECT_EVENTS` permission means step 3's security switch is still off.

## 5. Optional: typing Chinese or emoji

English typing works as is. For Chinese or emoji, install **and enable** ADBKeyBoard on the phone while adb is still running: https://github.com/senzhk/ADBKeyBoard (download `ADBKeyboard.apk` from its releases or repo, then run):

```sh
adb install ADBKeyboard.apk                     # the person may need to confirm on the phone [person]
adb shell ime enable com.android.adbkeyboard/.AdbIME
```

Without `ime enable`, Android keeps the keyboard disabled and Manina cannot switch to it.

## 6. Free the phone for the browser

Only one program can hold the phone's USB connection. Before using the web Playground, quit everything else that uses adb: Android Studio, scrcpy, phone assistant / phone manager apps, other tabs with the Playground open. Then run:

```sh
adb kill-server
```

Do this last, after all your adb checks and optional APK installs, and don't run adb commands again while the browser is connected (they restart the adb server and take the phone back). Skip this step if the person uses the `manina` CLI, which talks through adb.

## 7. Connect

Either:

- **Web Playground**: open https://manina.ai/llm#playground in desktop Chrome or Edge, sign in, pick the **Android (USB)** source and click **Connect phone**. In the browser's USB chooser the person picks their phone **[person]**. The page then checks taps and the keyboard and says what to fix, if anything.
- **Command line** (macOS / Linux):

  ```sh
  npm i -g manina
  manina login        # opens the browser to allow this computer [person]
  manina devices      # the phone should be listed
  manina run "Open Settings"
  ```

## If connecting fails

- "Another program is using the phone": an adb server or another tool still holds it. Repeat step 6.
- "The phone didn't allow this computer": repeat step 4.2.
- "The phone blocks taps from USB": step 3's extra switch (Xiaomi security settings, OPPO permission monitoring).
- Still stuck: unplug, try another cable or USB port, unlock the phone, connect again.

No phone at hand? The Playground can run on a sample screen first: https://manina.ai/llm#playground

Source: https://manina.ai/android-setup.md
