Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Duplicate CFBundleIdentifier in copied _Testing_* overlay frameworks breaks simulator install

Abierto Apto para principiantes
#175 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
ios, shell

Línea de trabajo

El error está en el bucle de copia de copy_bundle.sh, que ejecuta la fase de compilación de InjectionNext, y en el workaround propuesto fix_testing_framework_ids.sh. Empieza ejecutando el bucle de PlistBuddy del issue contra el directorio Frameworks de iPhoneSimulator de Xcode para confirmar que _Testing_CoreTransferable.framework informa el identificador de CoreGraphics. Está terminado cuando una compilación Debug se instala en un simulador con cada overlay Testing* con un CFBundleIdentifier único, y el script no hace nada fuera de Debug.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Note: includes fix

Summary

copy_bundle.sh copies every Testing*.framework from the platform developer frameworks directory into the app's Frameworks/ directory. Apple ships _Testing_CoreTransferable.framework with a copy-pasted CFBundleIdentifier that duplicates _Testing_CoreGraphics.framework's. Two frameworks sharing one identifier inside a single app bundle makes installd reject the install, so any Debug build with the InjectionNext build phase fails to launch on the simulator.

Error

Please try again later. Found bundle at
/Users/<me>/Library/Developer/CoreSimulator/Devices/<UDID>/data/Library/Caches/
com.apple.mobile.installd.staging/temp.Y6ODte/extracted/Payload/Allstar.app/
Frameworks/_Testing_CoreGraphics.framework with the same identifier
(com.apple.dt.swift-testing.overlay.CoreGraphics) as bundle at
.../Frameworks/_Testing_CoreTransferable.framework

Root cause

The identifiers as shipped by Xcode:

$ D="$(xcode-select -p)/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks"
$ for f in "$D"/_Testing_*.framework; do
    echo "$(basename $f): $(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$f/Info.plist")"
  done

_Testing_CoreGraphics.framework:      com.apple.dt.swift-testing.overlay.CoreGraphics
_Testing_CoreImage.framework:         com.apple.dt.swift-testing.overlay.CoreImage
_Testing_CoreTransferable.framework:  com.apple.dt.swift-testing.overlay.CoreGraphics   ← wrong
_Testing_Foundation.framework:        com.apple.dt.swift-testing.overlay.Foundation
_Testing_UIKit.framework:             com.apple.dt.swift-testing.overlay.UIKit

This is an Apple bug in the toolchain, but InjectionNext is what surfaces it: nothing else copies these overlays into a shipping app bundle. The relevant loop in copy_bundle.sh:

(cd "$PRODUCTS_DIR" && for fwork in $TESTING_FRAMEWORKS \
    "$PLATFORM_DEVELOPER_LIBRARY_DIR"/Frameworks
    TESTING_COPIED="$CODESIGNING_FOLDER_PATH/Frameworks/$(basename "$fwork")"
    if [ -f "$fwork/Info.plist" -a ! -d "$TESTIN
        rsync -a "$fwork" "$CODESIGNING_FOLDER_PATH/Frameworks" &&
        codesign -f --sign "$EXPANDED_CODE_SIGN_
            --preserve-metadata=identifier,entitlements,flags ... "$TESTING_COPIED"
    fi
done)

Note --preserve-metadata=identifier — the bad identifier is carried through to the signature as well.

Reproduce

  1. Add the standard InjectionNext run-script phase to an iOS app target.
  2. Build & run in Debug on a simulator with an Xansferable.framework carries the CoreGraphicsidentifier.
  3. Install fails with the error above. Allstar.ath overlays with identical CFBundleIdentifiers.

Environment

┌───────────────┬──────────────────────┐
│ │ │
├───────────────┼──────────────────────┤
│ Xcode │ 27.1 │
├───────────────┼──────────────────────┤
│ InjectionNext │ 2.0.1 |
├───────────────┼──────────────────────┤
│ Destination │ iOS Simulator, Debug │
└───────────────┴──────────────────────┘

Suggested fix (upstream)

Derive each overlay's identifier from its own fr, and stop preserving identifier when re-signing:

(cd "$PRODUCTS_DIR" && for fwork in $TESTING_FRA
    "$PLATFORM_DEVELOPER_LIBRARY_DIR"/Frameworks/_Testing_*.framework; do
    TESTING_COPIED="$CODESIGNING_FOLDER_PATH/Fra")"
    if [ -f "$fwork/Info.plist" -a ! -d "$TESTING_COPIED" ]; then
        rsync -a "$fwork" "$CODESIGNING_FOLDER_P
        # Xcode ships _Testing_CoreTransferable with CoreGraphics' identifier;
        # installd rejects two bundles sharing a
        OVERLAY="$(basename "$fwork" .framework)" &&
        /usr/libexec/PlistBuddy -c \
            "Set :CFBundleIdentifier com.apple.dt.swift-testing.overlay.${OVERLAY#_Testing_}" \
            "$TESTING_COPIED/Info.plist" &&
        codesign -f --sign "$EXPANDED_CODE_SIGN_IDENTITY" --timestamp=none \
            --preserve-metadata=entitlements,fla
            --generate-entitlement-der "$TESTING_COPIED"
    fi
done)

Rewriting all overlays (rather than special-casing CoreTransferable) keeps the script correct if Apple duplicates another
identifier later.

Workaround (verified working)

For anyone hitting this before an upstream fix lld phase after the InjectionNext phase thatrepairs the copied overlays in place.

BuildScripts/fix_testing_framework_ids.sh:

#!/bin/bash
#
# Apple ships _Testing_CoreTransferable.framework with the same CFBundleIdentifier as
# _Testing_CoreGraphics.framework (com.apple.dt.Graphics).
# InjectionNext's copy_bundle.sh copies every _Testing_* overlay into the app, and
# installd refuses to install a bundle containinidentifier.
#
# Rewrite each copied overlay's identifier to ma, then re-sign.
# Must run after the InjectionNext build phase.

[[ "$CONFIGURATION" =~ Debug ]] || exit 0

FRAMEWORKS="$CODESIGNING_FOLDER_PATH/Frameworks"
[ -d "$FRAMEWORKS" ] || exit 0

shopt -s nullglob
for fwork in "$FRAMEWORKS"/_Testing_*.framework; do
    plist="$fwork/Info.plist"
    [ -f "$plist" ] || continue

    name="$(basename "$fwork" .framework)"
    want="com.apple.dt.swift-testing.overlay.${n
    have="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$plist" 2>/dev/null)"
    [ "$have" == "$want" ] && continue

    echo "fixing $name: $have -> $want"
    /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $want" "$plist" &&
    codesign -f --sign "${EXPANDED_CODE_SIGN_IDEe \
        --preserve-metadata=entitlements,flags --generate-entitlement-der "$fwork"
done

Then chmod +x it and add a New Run Script Phase last (after InjectionNext):

"${SRCROOT}/BuildScripts/fix_testing_framework_i

It's idempotent, no-ops outside Debug, and --prey drops identifier so the new one makes it intothe signature.


Lenguaje dominante
Swift
Estrellas
437
Forks
32
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de johnno1962/InjectionNext

Todos los issues de johnno1962/InjectionNext

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.