ish

ish-app活跃维护

在 iOS 设备上跑起 Linux shell 的模拟器,靠用户态 x86 模拟执行命令行工具,让 iPhone/iPad 也能用上熟悉的 Linux 命令环境。

Linux shell for iOS

builds/813发布于 2026-08-22 06:20 UTC20,697star +14 / 7 天1,604fork同步于 2026-11-10 11:24 UTC

怎么上手

由 README 提炼,执行前请确认
git clone --recurse-submodules https://github.com/ish-app/ish.git
meson build
cd build && ninja
硬件要求按 README 说明

README 未说明硬件要求,仅提及在 iOS 设备上运行,以及命令行测试工具需要 64 位 Linux 4.11 或更高版本

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 iOS 上通过用户态 x86 模拟和系统调用翻译运行 Linux shell 的项目

在 iOS 设备上跑起 Linux shell 的模拟器,靠用户态 x86 模拟执行命令行工具,让 iPhone/iPad 也能用上熟悉的 Linux 命令环境。

核心能力

  • 用用户态 x86 模拟执行 Linux 程序
  • 通过系统调用翻译对接 iOS 系统
  • 解释器用 gadget 尾调用提速 3-5 倍
  • 提供 strace 等可编译期开启的日志通道
  • 支持在 Alpine 文件系统内运行命令

容易踩的坑

克隆时必须加 --recurse-submodules 或事后执行 git submodule update --init;构建依赖 Meson、Ninja、Clang/LLD、sqlite3 和 libarchive,缺 libarchive 会导致 tools/fakefsify 不生成;命令行测试需自行下载 Alpine i386 minirootfs 并用 tools/fakefsify 转换

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本builds/813
  1. builds/813Build 813pre-release最新正式版2026-08-22 · 2026-08-22 06:20 UTC

    Automated daily build

  2. builds/812Build 812pre-release2026-07-27 · 2026-07-27 07:29 UTC
    查看更新说明

    Automated daily build

  3. builds/811Build 811pre-release2026-07-18 · 2026-07-18 06:54 UTC
    查看更新说明

    Automated daily build

  4. builds/810Build 810pre-release2026-07-14 · 2026-07-14 14:10 UTC
    查看更新说明

    Automated daily build

  5. builds/809Build 809pre-release2026-07-14 · 2026-07-14 13:50 UTC
    查看更新说明

    Automated daily build

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    iSH

    Build Status goto counter fuck counter shit counter

    A project to get a Linux shell running on iOS, using usermode x86 emulation and syscall translation.

    For the current status of the project, check the issues tab, and the commit logs.

    Hacking

    This project has a git submodule, make sure to clone with --recurse-submodules or run git submodule update --init after cloning.

    You'll need these things to build the project:

    • Python 3
      • Meson (pip3 install meson)
    • Ninja
    • Clang and LLD (on mac, brew install llvm, on linux, sudo apt install clang lld or sudo pacman -S clang lld or whatever)
    • sqlite3 (this is so common it may already be installed on linux and is definitely already installed on mac. if not, do something like sudo apt install libsqlite3-dev)
    • libarchive (brew install libarchive, sudo port install libarchive, sudo apt install libarchive-dev) TODO: bundle this dependency

    Build for iOS

    Open the project in Xcode, open iSH.xcconfig, and change ROOT_BUNDLE_IDENTIFIER to something unique. You'll also need to update the development team ID in the project (not target!) build settings. Then click Run. There are scripts that should do everything else automatically. If you run into any problems, open an issue and I'll try to help.

    Build command line tool for testing

    To set up your environment, cd to the project and run meson build to create a build directory in build. Then cd to the build directory and run ninja.

    To set up a self-contained Alpine linux filesystem, download the Alpine minirootfs tarball for i386 from the Alpine website and run ./tools/fakefsify, with the minirootfs tarball as the first argument and the name of the output directory as the second argument. Then you can run things inside the Alpine filesystem with ./ish -f alpine /bin/sh, assuming the output directory is called alpine. If tools/fakefsify doesn't exist for you in your build directory, that might be because it couldn't find libarchive on your system (see above for ways to install it.)

    You can replace ish with tools/ptraceomatic to run the program in a real process and single step and compare the registers at each step. I use it for debugging. Requires 64-bit Linux 4.11 or later.

    Logging

    iSH has several logging channels which can be enabled at build time. By default, all of them are disabled. To enable them:

    • In Xcode: Set the ISH_LOG setting in iSH.xcconfig to a space-separated list of log channels.
    • With Meson (command line tool for testing): Run meson configure -Dlog="<space-separated list of log channels>".

    Available channels:

    • strace: The most useful channel, logs the parameters and return value of almost every system call.
    • instr: Logs every instruction executed by the emulator. This slows things down a lot.
    • verbose: Debug logs that don't fit into another category.
    • Grep for DEFAULT_CHANNEL to see if more log channels have been added since this list was updated.

    A note on the interpreter

    Possibly the most interesting thing I wrote as part of iSH is the interpreter. It's not quite a JIT since it doesn't target machine code. Instead it generates an array of pointers to functions called gadgets, and each gadget ends with a tailcall to the next function; like the threaded code technique used by some Forth interpreters. The result is a speedup of roughly 3-5x compared to emulation using a simpler switch dispatch.

    Unfortunately, I made the decision to write nearly all of the gadgets in assembly language. This was probably a good decision with regards to performance (though I'll never know for sure), but a horrible decision with regards to readability, maintainability, and my sanity. The amount of bullshit I've had to put up with from the compiler/assembler/linker is insane. It's like there's a demon in there that makes sure my code is sufficiently deformed, and if not, makes up stupid reasons why it shouldn't compile. In order to stay sane while writing this code, I've had to ignore best practices in code structure and naming. You'll find macros and variables with such descriptive names as ss and s and a. Assembler macros nested beyond belief. And to top it off, there are almost no comments.

    So a warning: Long-term exposure to this code may cause loss of sanity, nightmares about GAS macros and linker errors, or any number of other debilitating side effects. This code is known to the State of California to cause cancer, birth defects, and reproductive harm.