Skip to content

Instantly share code, notes, and snippets.

@frank-dspeed
Forked from rishabhrpg/puppeteer_on_termux.md
Created December 30, 2020 12:41
Show Gist options
  • Save frank-dspeed/2f919fc3d8d877270f0ad3300388dc28 to your computer and use it in GitHub Desktop.
Save frank-dspeed/2f919fc3d8d877270f0ad3300388dc28 to your computer and use it in GitHub Desktop.
Run puppeteer inside termux

Run Puppeteer inside termux

Assumptions

  • You have termux installed and have sufficient permissions
  • You have loggedin as root user
  • You are okay with running Puppeteer inside a container (Alpine)

Gotchas

  • There is no build of Google Chrome available for ARM at this moment, so using chromium instead.
  • Installing chromium on Termux directly requires snap which is another big hurdle so alternively using alpine distro here.

Steps

proot-distro install alpine
proot-distro login alpine
apk update && apk add --no-cache nmap && \
  echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \
  echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \
  apk update && \
  apk add --no-cache \
  chromium
git clone https://github.com/rishabhrpg/puppeteer-on-termux.git
cd puppeteer-on-termux
yarn
node index.js
  • If you see a message "screenshot saved" then puppeteer is sucesfully configured to run on termux
  • Use repo puppeteer-on-termux as starting point as it has correct args included to sucesfully run chromium on termux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment