Building for ISH

Date: 2025 10-October 06

TLDR

apk add --no-cache py3-numpy
apk add py3-cryptography


1️⃣ Architecture compatibility

Implication:


2️⃣ Using PRoot Alpine on Termux


3️⃣ Options to produce an iSH-compatible binary

  1. Cross-compile with PyInstaller:

    • PyInstaller does not natively support cross-compilation from ARM → x86_64.
    • You’d need an x86_64 chroot or container environment to build the binary.
  2. Build directly in iSH:

    • Install Alpine packages inside iSH (apk add python3 py3-pip py3-setuptools py3-wheel py3-cryptography py3-cffi py3-musl-dev binutils)
    • Set up a venv in iSH.
    • Install your requirements and PyInstaller in that environment.
    • Run build_executible.py → the output will be x86_64 ELF, compatible with iSH.

4️⃣ TL;DR

Once copied to the right folder on an ISH installation, is there a way to launch the executible through iOS shortcuts, without running from the terminal directly?

Yes — you can trigger a command-line executable in iSH via iOS Shortcuts, but it’s a bit indirect because iOS can’t natively run Linux binaries — it relies on iSH as the execution environment. Here’s how it works:


1. Make sure your executable is ready

chmod +x ~/pipeline/pipeline-eds-0.3.10-py310-alpine3.17.0-x86_64
~/pipeline/pipeline-eds-0.3.10-py310-alpine3.17.0-x86_64 --help

2. Create a small shell script as a wrapper

iOS Shortcuts can call scripts via URL schemes. It’s easier to wrap your executable in a script:

#!/bin/sh
# ~/pipeline/run_pipeline.sh
~/pipeline/pipeline-eds-0.3.10-py310-alpine3.17.0-x86_64 "$@"

Make it executable:

chmod +x ~/pipeline/run_pipeline.sh

3. Use iSH’s URL scheme in Shortcuts

ish://term?command=/root/pipeline/run_pipeline.sh%20arg1%20arg2

4. Optional: Auto-launch iSH in background


Summary


If you want, I can write a ready-to-use shortcut URL that launches your pipeline-eds binary with a preset command, so you can run it from your iOS home screen with one tap.

ish://term?command=/root/pipeline/run_pipeline.sh%20trend%20--help ; This goes into the safari browser bar?

Yep

Cheat Sheet

Here’s a concise cheat sheet for iSH URL encoding when launching commands via ish://term?command=.... Anything that could be interpreted by the URL parser or the shell needs attention:

Character URL-safe? URL Encoding Notes
Space %20 Must always encode spaces
Hyphen - Safe, used in options like --help
Underscore _ Safe
Period . Safe, e.g., filenames
Slash / Path separator
Backslash \ %5C Rarely needed, mostly Windows paths
Question mark ? %3F Otherwise interpreted as URL query start
Ampersand & %26 Otherwise treated as URL param separator
Equal = %3D Needed if part of value assignment in URL
Hash # %23 Otherwise treated as URL fragment
Plus + %2B Otherwise treated as space in some contexts
Colon : Generally safe, e.g., /usr/bin
Semicolon ; %3B Could be interpreted as shell command separator
Quotes ' / " %27 / %22 Must encode if part of argument
Dollar $ %24 Avoid unless you want shell variable expansion
Parentheses () %28 / %29 Encode if literal argument
Comma , Safe, used in arguments like lists

Rule of thumb:

If you want, I can draft a ready-to-use iOS Shortcut template that lets you enter arguments for iSH commands and automatically encodes everything properly. This avoids manual %20 and other encodings.