Could not attach to pid : “####” unable to attach [duplicate]
Asked Answered
M

6

42

I just updated to Xcode 7.3.1 and my project crashes with the same error after the launch screen displays on the iOS simulator.

The error is:

"Could not attach to pid : “1712” unable to attach"

Then I tried running another project and I got:

"Could not attach to pid : “2025” unable to attach"

Any solutions?

Mauricemauricio answered 2/6, 2016 at 3:24 Comment(5)
did you try clean, rebuild, restart?Daubery
Wish any of the below answers would work for me :(Pilose
None of the answers on this page worked for me. I found a solution involving attaching to the process already running in the simulator. This page no longer allows answers, so I am putting the details here: https://mcmap.net/q/187629/-failed-to-attach-to-process-id-xcodeSiegfried
I had the problem because of slow internet connectionDaystar
De-Selecting Debug Executable option under edit scheme fixed it for me!Sheets
G
37

Resetting the content and settings in the simulator worked for me. This is available on the iOS Simulator: Hardware -> Erase all Content and Settings

Geddes answered 2/6, 2016 at 4:16 Comment(3)
in most of the cases, this is actually the correct answer.Gastrotrich
The menu item is now called Hardware -> Erase All Content And Settings.Mukul
The menu item is now called Device -> Erase All Content And SettingsDivisive
D
23

Kill the simulator, then re-build.

Devitt answered 2/6, 2016 at 5:49 Comment(3)
Actually, you don't even need to kill the simulator, re-building make it work for me.Afterguard
I usually just re-run it. But re-building is what's intended here.Wherever
None of these worked for me. killing the simulator, deleting the app, switching simulator, rebuilding, deleting derived data, cleaning build folder, cleaning project, none worked.Kendrick
E
18
  1. I closed Xcode.
  2. On the simulator menu: go to Hardware -> Erase all content and settings. Erase all content and settings
  3. Open Xcode then build and run the application.

The above simple steps worked for me.

Eyla answered 2/3, 2018 at 8:42 Comment(1)
The order of the steps as shown here solved it for me.Sleety
V
10
  1. Close Xcode & simulator
  2. Reopen Xcode & rebuild

Above steps worked for me.

Vaillancourt answered 12/12, 2017 at 0:51 Comment(0)
C
7

In my case Xcode 8.0 after this error,just rebuild again project it solves this problem.

There is no need for reset app content in iPhone device.

Cauterize answered 18/5, 2017 at 4:44 Comment(0)
L
-1

Clean the project,quit the simulator and then rebuild the app

Larios answered 5/10, 2017 at 2:0 Comment(1)
Cleaning the project and then running always make the trick for me.Invercargill

© 2022 - 2024 — McMap. All rights reserved.