Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,28 @@ Configure Developer Options, Stay Awake, and battery optimization to prevent And
Open Termux and run:

```bash
pkg update -y && pkg install -y curl
pkg update -y && pkg upgrade -y
pkg install -y curl openssl libngtcp2 ca-certificates
```

If Termux prints an error like `CANNOT LINK EXECUTABLE "curl"` or mentions
`SSL_set_quic_tls_transport_params`, your Termux SSL/HTTP packages are out of
sync. Re-run the two commands above, then start a fresh Termux session or run
`hash -r` before installing OCA.

#### Step 4: Install OCA 🚀

```bash
curl -sL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh | bash && source ~/.bashrc
BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP" \
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
Comment on lines +83 to +86

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.

Suggested change
BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP" \
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
&& bash "$BOOTSTRAP" \\
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"

```

This downloads the bootstrap script first instead of piping directly into
`bash`, so a broken `curl` cannot accidentally run an empty installer and then
try to source a missing `~/.bashrc`.

Takes 3-10 minutes depending on network and device.

#### Step 5: Automatic glibc extras layer
Expand Down Expand Up @@ -459,7 +472,9 @@ Using _Jarvis (RTX⚡)_
### 🚀 Ready to transform your Android phone?

```bash
curl -sL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh | bash
BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP"
Comment on lines +475 to +477

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.

Suggested change
BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP"
BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
&& bash "$BOOTSTRAP"

```

**Your phone is now an AI server.** ⚡
Expand Down
30 changes: 26 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
#!/usr/bin/env bash
# bootstrap.sh - Download and run OpenClaw on Android installer
# Usage: curl -sL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/main/bootstrap.sh | bash
# Usage:
# curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o /tmp/oca-bootstrap.sh \
# && bash /tmp/oca-bootstrap.sh
Comment on lines +3 to +5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The usage comment suggests downloading the bootstrap script to /tmp/oca-bootstrap.sh. However, in Termux/Android, /tmp is not a writable directory and does not exist by default. Copying and running this command directly will fail with a 'No such file or directory' or 'Permission denied' error. It is safer to use a path relative to $HOME or use the ${TMPDIR:-$HOME} pattern to ensure compatibility with Termux.

Suggested change
# Usage:
# curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o /tmp/oca-bootstrap.sh \
# && bash /tmp/oca-bootstrap.sh
# Usage:
# BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
# curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
# && bash "$BOOTSTRAP"

set -euo pipefail

REPO_TARBALL="https://github.com/PsProsen-Dev/OpenClaw-On-Android/archive/refs/heads/master.tar.gz"
INSTALL_DIR="$HOME/.oca/installer"

RED='\033[0;31m'
BOLD='\033[1m'
YELLOW='\033[1;33m'
NC='\033[0m'

print_curl_repair_hint() {
echo -e "${YELLOW}[FIX]${NC} Termux curl/OpenSSL packages look out of sync. Run:"
echo ""
echo " pkg update -y && pkg upgrade -y"
echo " pkg install -y curl openssl libngtcp2 ca-certificates"
echo " hash -r"
echo ""
echo "Then re-run the OCA install command."
}

echo ""
echo -e "${BOLD}OpenClaw on Android - Bootstrap${NC}"
echo ""

if ! command -v curl &>/dev/null; then
echo -e "${RED}[FAIL]${NC} curl not found. Install it with: pkg install curl"
if command -v curl &>/dev/null; then
if ! curl --version &>/dev/null; then
echo -e "${RED}[FAIL]${NC} curl is installed but cannot start."
print_curl_repair_hint
exit 1
fi
DOWNLOADER=(curl -sfL "$REPO_TARBALL")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using curl -sfL silences all output, including error messages when the download fails (due to -s without -S). If the download fails due to network or DNS issues, the script will exit silently without providing any helpful error message. Changing this to curl -fsSL (which includes -S / --show-error) will ensure that error messages are printed to stderr if the download fails, while keeping the progress bar silent.

Suggested change
DOWNLOADER=(curl -sfL "$REPO_TARBALL")
DOWNLOADER=(curl -fsSL "$REPO_TARBALL")

elif command -v wget &>/dev/null; then
DOWNLOADER=(wget -qO- "$REPO_TARBALL")
else
echo -e "${RED}[FAIL]${NC} curl/wget not found. Install one with: pkg install curl"
exit 1
fi
Comment on lines +30 to 42

echo "Downloading installer..."
mkdir -p "$INSTALL_DIR"
curl -sfL "$REPO_TARBALL" | tar xz -C "$INSTALL_DIR" --strip-components=1
"${DOWNLOADER[@]}" | tar xz -C "$INSTALL_DIR" --strip-components=1

bash "$INSTALL_DIR/install.sh"

Expand Down
5 changes: 4 additions & 1 deletion docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,8 @@ bash ~/.oca/scripts/install-nodejs.sh
bash ~/.oca/platforms/openclaw/install.sh

# Full reinstall
oca --uninstall && curl -sL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh | bash
oca --uninstall
BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP"
Comment on lines +144 to +147
Comment on lines +145 to +147

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.

BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
  && bash "$BOOTSTRAP"

```
23 changes: 21 additions & 2 deletions docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,31 @@ OCA works with multiple free AI providers — no credit card needed to get start

## Step 1 — Run the bootstrap

Open Termux and paste this single command:
Open Termux and first refresh the packages that `curl` links against:

```bash
curl -sL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh | bash && source ~/.bashrc
pkg update -y && pkg upgrade -y
pkg install -y curl openssl libngtcp2 ca-certificates
```

If you see `CANNOT LINK EXECUTABLE "curl"` or
`SSL_set_quic_tls_transport_params`, the Termux `curl`/OpenSSL packages are
out of sync. Run the two commands above, then run `hash -r` or reopen Termux.

Then paste this install command:

```bash
BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP" \
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
Comment on lines +50 to +53
Comment on lines +50 to +53

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.

BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
  && bash "$BOOTSTRAP" \\
  && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"

```

This avoids the classic `curl | bash && source ~/.bashrc` trap: if `curl`
fails before downloading anything, `bash` can otherwise receive empty input and
return success, which makes the shell try to source a `.bashrc` that the
installer never created.

---

## Step 2 — Answer the prompts
Expand Down
35 changes: 31 additions & 4 deletions docs/support/common-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,34 @@ npm clean-cache --force
npm install -g openclaw@latest
```

## 2. Sharp Compilation Errors
## 2. `curl` fails with `SSL_set_quic_tls_transport_params`

**Error:** Before the installer starts, Termux prints something like:

```text
CANNOT LINK EXECUTABLE "curl": cannot locate symbol "SSL_set_quic_tls_transport_params" referenced by ".../libngtcp2_crypto_ossl.so"...
bash: .../home/.bashrc: No such file or directory
```

**Cause:** Termux upgraded only part of the HTTP/TLS stack. `curl`, `openssl`,
and `libngtcp2` must come from a matching package set. The `.bashrc` message is
a follow-on symptom from the old `curl | bash && source ~/.bashrc` pattern: no
installer was downloaded, so no `.bashrc` was created.

**Fix:** Repair the Termux packages and use the safe bootstrap command:

```bash
pkg update -y && pkg upgrade -y
pkg install -y curl openssl libngtcp2 ca-certificates
hash -r

BOOTSTRAP="${TMPDIR:-/tmp}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \
&& bash "$BOOTSTRAP" \
&& [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
Comment on lines +44 to +47

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using /tmp as a fallback when TMPDIR is unset will fail in Termux because /tmp is not a writable directory on Android. Falling back to $HOME (i.e., ${TMPDIR:-$HOME}) is much safer and guaranteed to be writable in Termux.

BOOTSTRAP="${TMPDIR:-$HOME}/oca-bootstrap.sh"
curl -fsSL https://raw.githubusercontent.com/PsProsen-Dev/OpenClaw-On-Android/master/bootstrap.sh -o "$BOOTSTRAP" \\
  && bash "$BOOTSTRAP" \\
  && [ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"

```

## 3. Sharp Compilation Errors

**Error:** `sharp: Installation error: Use with glibc ... is not supported`

Expand All @@ -33,7 +60,7 @@ export npm_config_build_from_source=true
npm rebuild sharp
```

## 3. "Cannot find module 'bionic-compat'"
## 4. "Cannot find module 'bionic-compat'"

**Error:** When starting `openclaw gateway`, it crashes immediately complaining about `bionic-compat.js`.

Expand All @@ -45,15 +72,15 @@ cd /data/data/com.termux/files/usr/lib/node_modules/openclaw/
# Download the shims as per the manual setup guide
```

## 4. Network/DNS Errors (EAI_AGAIN)
## 5. Network/DNS Errors (EAI_AGAIN)

**Error:** The agent fails to connect to the LLM provider with `getaddrinfo EAI_AGAIN api.openai.com`.

**Cause:** Android's DNS resolution differs from standard Linux. Node.js sometimes fails to resolve domain names in Termux.
**Fix:**
Ensure `proxy.js` is installed and correctly overriding the DNS resolution to use Google/Cloudflare DNS directly (8.8.8.8 / 1.1.1.1). Our bootstrap script applies this automatically.

## 5. Gateway Keeps Shutting Down
## 6. Gateway Keeps Shutting Down

**Error:** You lock your phone, and a few minutes later, the bot stops responding.

Expand Down
Loading