Skip to content

Instantly share code, notes, and snippets.

@rishabhrpg
Last active October 7, 2024 13:00
Show Gist options
  • Save rishabhrpg/4025ff5da4f0159af1850cb358279e57 to your computer and use it in GitHub Desktop.
Save rishabhrpg/4025ff5da4f0159af1850cb358279e57 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 successfully 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

This tutoraial has been moved here [https://github.com/rishabhrpg/puppeteer-on-termux]

@agreeed
Copy link

agreeed commented Sep 19, 2024

kill yourself nigger

@DewandaArya
Copy link

kill yourself nigger

the fuck?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment