Skip to content

AltJIT: attach failed (Not allowed to attach) when app has multiple PIDs; needs PID retry/selection #1710

@khj1212k

Description

@khj1212k

Environment

  • macOS 26.3 (25D125)
  • AltServer 1.7.2 (build 90) with bundled altjit
  • iPadOS 26.2.1 (23C71)

Problem
AltJIT can fail with:
"Could not attach debugger ... Not allowed to attach to process".

In my case the app spawns multiple processes with the same name (ManicEmu). AltJIT sometimes picks a PID that denies attach, while another PID attaches fine and JIT is enabled.

Example output (PID redacted, but the key part is attach denial):

  • Started debugserver on port ####
  • Attaching debugger...
  • (lldb) attach -p
  • error: attach failed (Not allowed to attach to process)

Repro (happens frequently)

  1. Connect iPad over USB, unlock it, open Manic EMU, keep it in the foreground.
  2. Run: sudo /Applications/AltServer.app/Contents/MacOS/altjit enable "Manic EMU" --udid
  3. AltJIT starts debugserver, then LLDB attach fails with "Not allowed to attach to process".
  4. Listing processes shows multiple PIDs for ManicEmu:
    • python3 -m pymobiledevice3 processes pgrep --udid ManicEmu
  5. Re-running altjit with the other PID succeeds:
    • sudo .../altjit enable <other_pid> --udid

Expected

  • Enabling JIT by app name should be reliable.

Suggested fix

  • When enabling by app name/bundle, enumerate candidate PIDs and retry attach if the first one is denied (newest PID first is often the right one).
  • Alternatively, resolve the correct main app PID via SpringBoard/frontmost app/bundle id rather than a name match.
  • If attach fails, show candidate PIDs in the error so users can recover.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions