Tcl/Tk on your iPhone and iPad.
The real Tcl interpreter and the real Tk widgets, running on the device: AndroWish's batteries-included wish, ported to iOS and iPadOS with more than 100 extensions, Bluetooth LE and a set of demo apps. No App Store, no Xcode: install it with SideStep.
Two-minute tour
Installing it with SideStep, the Tcl console, the bundled packages and demos, BLT plotting, borg reaching the iPad itself, the Bluetooth LE debugger, touch, and AndroWish apps running unmodified.
What it's for
Apple's App Store doesn't accept apps that run a scripting language, so Tcl/Tk has never been available on an iPhone. iWish is the whole thing, packaged as an app you install yourself.
The same Tk widgets and canvas you use on a desktop, drawn on the device. A large real-world Tk app, Decent's espresso tablet software, runs on it end to end.
About 115 packages come bundled: sqlite3, tls, TclCurl, tdom, Img, BLT and TkBLT plotting, Tktable, itcl, thread and more.
The ble command scans, connects and reads Bluetooth LE devices through CoreBluetooth, and borg reaches the screen, speech and device info.
Type Tcl straight into the iPad. Familiar commands like ls, cat and grep work, written in pure Tcl since iOS forbids running programs.
Install it
iWish isn't on the App Store. SideStep, a free Mac app, signs it with your own Apple ID (a free one works) and keeps it signed and up to date.
On a Mac, click Install iWish with SideStep below. If SideStep is already installed it opens straight to iWish.
No SideStep yet? The button downloads the iWish installer instead. It installs SideStep, then walks you through plugging in your iPhone or iPad, tapping Trust and turning on Developer Mode.
On the device, open Settings ▸ General ▸ VPN & Device Management and trust your Apple ID. Then open iWish and pick a demo from File ▸ Demos.
Already use AltStore or SideStore? On the iPhone or iPad, tap Add iWish to AltStore or Add iWish to SideStore, then tap Get. The iWish.ipa on GitHub also installs with any sideloader; see INSTALL.md.
How it works
There's no web view and no bridge to Apple's own buttons and menus. iWish runs AndroWish's undroidwish on the device:
arm64-apple-ios, in a single binary.borg for the device, ble for Bluetooth, hardexit for a clean quit.
Technical details
iWish is a port of AndroWish's undroidwish — the batteries-included, SDL2-rendered Tcl/Tk wish — to iOS and iPadOS (with a Mac Catalyst build alongside).
It runs a real Tcl 8.6 interpreter and the real Tk 8.6 widget set on an iPhone or iPad. Tk is drawn through AndroWish's SdlTk — an X11-on-SDL2 emulation layer — using the AGG anti-aliased renderer for graphics and FreeType for text, composited onto an SDL2 Metal surface. There is no WebView and no native-UIKit-widget bridge: it is the actual Tk canvas and widgets, running on the device.
The whole stack — Tcl, Tk/SdlTk, SDL2, AGG, FreeType — is statically linked into a single sdl2wish binary, compiled for arm64-apple-ios.
0.2 — alpha. The runtime runs a large third-party Tk application end-to-end on a physical iPad: full GUI, the batteries-included extension set, a bundled demo menu, and hardware access over CoreBluetooth. APIs, the build layout, and the bundled extension set are still in flux.
TCL_UTF_MAX=6 (UCS-4) so astral-plane characters and arrows render correctly. Stock builds (UTF_MAX=3) garble them; the UTF6 rebuild is verified by the full Tcl and Tk regression suites.de1app) has been booted on a physical iPad and connected to a DE1 espresso machine over CoreBluetooth, on-device rather than in the simulator..framework packaging fix. v0.2.2 went into the SideStep catalog with a one-click installer (checked by installing it through SideStep on an iPhone 14 Pro Max running iOS 27, October 2026).Documents/autostart.tcl at launch if there is one; it is now the version SideStep installs.Every build (device and Catalyst) bundles the AndroWish extension set plus built-in demo apps; the bare runtime is not shipped separately.
arm64-apple-ios dylibs, totaling roughly 80 MB.blt::graph/barchart/vector), Tix, vectcl, tksvg, and more.bltgraph (live TkBLT plotting + PostScript export), bledemo (a LightBlue-style BLE debugger — scan, connect, browse services/characteristics, read/subscribe/write), borgdemo (the borg iOS device bridge), and paint. Extensions that can't exist on iOS (Windows-only, Linux/Android hardware, fork/exec, huge external native libs) appear greyed-out.borg → UIScreen brightness, device/screen info, URL opening, AVSpeech text-to-speech, a native toast, plus a platform subcommand (ios / iossimulator / maccatalyst) so Tcl can identify the run target at runtime.ble → CoreBluetooth (scan / connect / read / write / notify), using the peripheral's CoreBluetooth UUID as its address since iOS hides the hardware MAC.hardexit → a one-command dylib that calls _exit(). On iOS, Tcl's normal exit (which runs Tcl_Finalize) hangs and leaves a blank window; routing exit through hardexit gives a clean quit.fork/exec, exec ls/cat/cp/… can never work in a packaged app. iWish supplies pure-Tcl replacements (ls cat head tail grep wc cp mv rm mkdir touch find echo …) wired into init.tcl so they exist in every interpreter, not just the console. They never shadow a name a program already defines.The repo is a recipe — build scripts, a set of patches against upstream, and the iOS-native glue code. It does not redistribute AndroWish, SDL2, or Tcl/Tk; you fetch those and apply the patches.
Rough shape of a build:
apply-patches.sh).sdl2wish — all for arm64-apple-ios, at TCL_UTF_MAX=6.lib-batteries/.src-ios/ shims (borg / ble / hardexit) to dylibs..app: the renamed sdl2wish binary, lib/tcl8.6 + lib/tk8.6, main.tcl + payload, an Info.plist (landscape orientations, status bar hidden, MinimumOSVersion 15.0), and the lib-batteries/.actool)..framework bundle under Frameworks/ (see Implementation notes) — required for AltStore/SideStore.Signing uses a standard Apple Development certificate plus a provisioning profile that includes the target device's UDID. Distribution is via TestFlight / sideload / EU notarization — App Store policy 2.5.2 forbids interpreters that load downloaded code. (This page omits the project's private signing identities, team IDs, device UDIDs, and local paths.)
The port reconciles a threaded X11-style toolkit with UIKit's main-thread rules and pixel model. Fixes:
Keyboard input. SDL2's UIKit backend registers a GameController keyboard and then skips delivering normal key presses, expecting a handler that never fires for ordinary typing — so keys vanished. The fix disables the GameController keyboard path so keys flow through the standard press handlers. Related device fixes eliminated double-typed characters (hardware key + hidden text-field both firing) and made Shift produce shifted symbols (Shift+= → +) via an ANSI shift map gated on Shift, not CapsLock.
Mouse, drag, and cursor. On Catalyst and iPad the pointer arrives as an indirect (trackpad) touch, not a classic mouse. Fixes route it through the touch handlers, add drag-motion reporting, correct a button-release bug (the pressed bit is already cleared at release time, so releases were lost), and add a cursor driver that morphs the pointer into resize/move shapes — using AppKit's NSCursor via the Objective-C runtime on Catalyst, and a custom bezier double-arrow UIPointerStyle on the device.
Keyboard-caret crash (SIGABRT). undroidwish runs Tcl/Tk on a secondary thread. Tk's caret update eventually set a UIView frame off the main thread, and UIKit's safe-area recalculation throws when that happens off-main → abort. The fix bounces the frame update to the main thread and skips it when it's a no-op. A recurring lesson across the port: never dispatch_sync from the Tcl thread to the main queue (the main thread is busy in the SDL/Tk loop and not servicing the main queue → deadlock) — always dispatch_async.
Screen auto-size and fill. On the real device iWish adopts the native screen size automatically; the fixed-resolution pins are all Catalyst-only. Pinning SdlTk's virtual screen to the native size, using SDL_RenderSetLogicalSize to scale the present, and ignoring spurious window-resize events made the Tk surface fill the display and map input back correctly.
Colour correctness on Catalyst. The whole UI came up red/blue-swapped. SDL_GetWindowPixelFormat reported ABGR8888, but the actual Metal drawable is BGRA; SDL presented without converting. Forcing the surface and textures to ARGB8888 (== BGRA) on Catalyst fixed every colour at the final present, and AGG adapts to match.
Catalyst beachball. SdlTk's event loop blocks forever on the main thread with SDL_WaitEvent, but on Catalyst AppKit owns the main run loop, so never returning to it reads as "not responding". The fix returns the main thread to AppKit and drives Tk from a per-frame CADisplayLink callback instead.
AltStore/SideStore packaging. iWish bundles ~64 native dylibs. AltStore/SideStore re-sign with ldid, which only re-signs the executable and nested bundles (Frameworks/*.framework, PlugIns/*.appex) — a loose .dylib, even inside Frameworks/, keeps its original signature and iOS rejects the install (0xe8008001). The fix wraps every dylib in its own .framework bundle and rewrites the Tcl load paths. (A deeper root cause — ldid emitting a legacy SHA-1-primary code directory that iOS 26 rejects — is why a modern, codesign-equivalent signer is ultimately needed for reliable free-account sideloading.)
Source, build scripts, and patches: https://github.com/johnbuckman/iwish
Part of the Tcl/Tk on modern platforms collection. Sibling projects build the same stack as a native Apple-Silicon macOS binary and as a 32-bit armv7 / iOS 9 full-source snapshot for old jailbroken devices.