Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions docs/platforms/ios-app-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,28 @@ before. `PyConfig.home` is the non-deprecated route, but the library carries no

## Wiring an app

The sample's project is `iosApp/iosApp.xcodeproj` (product `PythonDemo.app`, bundle id
The sample's project is `sample/src/iosMain/app.xcodeproj` (target `app`, product `PythonDemo.app`, bundle id
`org.thisisthepy.python.multiplatform.demo`). Its phase:

```sh
set -e
cd "$SRCROOT/.."
export PYTHON_PAYLOAD_DIR="$SRCROOT/../sample/src/commonMain/python"
cd "$SRCROOT/../../.."
export PYTHON_PAYLOAD_DIR="$SRCROOT/../commonMain/python"
/bin/bash tools/xcode/install-python.sh
```

It replaced two phases: "Install Target Specific Python Standard Library", which rsynced the slice's
`lib/`, only `libpython3.14.dylib`, into `<app>/lib/`, and "Prepare Python Binary Modules", which
did the framework wrapping from a template copied in as a resource. `iosApp/iosApp/dylib-Info-template.plist`
is no longer copied into the app; the file itself is still in the project.
did the framework wrapping from a template copied in as a resource. The template is no longer copied
into the app: `install-python.sh` takes the one the Gradle plugin stages (`PYTHON_DYLIB_INFO_TEMPLATE`).

`sample/src/iosMain/app.xcodeproj` is not wired: it still references `../../dist/toolchain/...` and
a `ComposeApp` framework that this build does not produce, and has never been built here.
The project used to live in a root `iosApp/` folder. It moved to `sample/src/iosMain/` (the
app-template layout, #107); the old `python` folder reference to `build/pythonStaging/ios/python`
and the `../../dist/toolchain/...` references were removed, because `install-python.sh` already
copies the payload to `<app>/python/` and a second copy would conflict. The target runs two Gradle
tasks first (`:python-multiplatform:embedAndSignAppleFrameworkForXcode`,
`:sample:embedAndSignAppleFrameworkForXcode`), then compiles, then installs Python, then embeds
`Python.xcframework`.

A consumer outside this repository cannot call `:python-multiplatform:stageIosPythonHomeForXcode`:
the iOS archive download lives in this repository's build script, not in the published plugin. That
Expand Down Expand Up @@ -138,14 +143,14 @@ EFFECTIVE_PLATFORM_NAME=-iphonesimulator ARCHS="arm64 x86_64" \
# 2. Build the app (flags from the last verified run, ROADMAP history 2026-08-13: actool cannot
# compile the app icon against this machine's simulator runtimes, and -target avoids
# -destination's eligibility check)
(cd iosApp && xcodebuild -project iosApp.xcodeproj -target iosApp -configuration Debug \
-sdk iphonesimulator ARCHS=arm64 ONLY_ACTIVE_ARCH=YES SYMROOT="$PWD/build" \
xcodebuild -project sample/src/iosMain/app.xcodeproj -target app -configuration Debug \
-sdk iphonesimulator ARCHS=arm64 ONLY_ACTIVE_ARCH=YES SYMROOT="$PWD/sample/build/xcode-app" \
ASSETCATALOG_COMPILER_APPICON_NAME="" \
CODE_SIGN_IDENTITY="-" CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM="" build) \
CODE_SIGN_IDENTITY="-" CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM="" build \
> .tmp/xcodebuild.log 2>&1; echo "EXIT=$?"
grep -E "Installing the Python|Wrapped|error:" .tmp/xcodebuild.log

APP=iosApp/build/Debug-iphonesimulator/PythonDemo.app
APP=sample/build/xcode-app/Debug-iphonesimulator/PythonDemo.app
ls "$APP/python-multiplatform-home/lib/python3.14/os.py" "$APP/python/example_py/__init__.py"
ls "$APP/python-multiplatform-home/lib/python3.14/lib-dynload" | grep -c '\.fwork$' # 67 for 3.14
find "$APP/python-multiplatform-home" "$APP/python" -name '*.so' | wc -l # 0
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ trampolines exist. GraalVM native image upcalls are verified by hand
open.** SPEC L-11, issue #59, `docs/platforms/ios-app-bundle.md`: per-slice staging
(`stageIosPythonHome_*`, `stageIosPythonHomeForXcode`), `tools/xcode/install-python.sh` (stdlib to
`<app>/python-multiplatform-home/`, payload to `<app>/python/`, `.so` wrapped as frameworks with
`.fwork` placeholders) replacing `iosApp/`'s two broken phases, and `IosPythonHome` +
`.fwork` placeholders) replacing the two broken phases of the old root `iosApp/` (now `sample/src/iosMain/app.xcodeproj`, #107), and `IosPythonHome` +
`Py_SetPythonHome` at run time. Left: the installed-app run on the simulator with no
`SIMCTL_CHILD_*` (the page's "Checking it"); a device run; and a way for consumers outside this
repository to stage the stdlib (the iOS archive download is in this build script, not the plugin).
Expand Down
3 changes: 0 additions & 3 deletions iosApp/Configuration/Config.xcconfig

This file was deleted.

Loading
Loading