ChatGPT解决这个技术问题 Extra ChatGPT

Xcode 6 process launch failed: timed out trying to launch app

I can't debug my app because when I run it, Xcode gives me the error:

Process launch failed: timed out trying to launch app

In the device I see a black screen and after the error message the app starts. How can I fix this?

I tried to change the code signing identity and the provisioning profile, and to refresh the provisioning profiles in the Xcode > Preferences > Accounts > Details tab.

I'm using Xcode Version 6.0.1 (6A317) with an iPad mini, running iOS 8.0 and a MacBook with OSX 10.9.4.

After this, if the iPad goes into sleep mode (the screen turns off) I can't wake it anymore; I have to do a soft reset.

For future readers who, like me, tried everything here to no avail: You may have luck by clearing the provisioning profiles from your device. To do this in Xcode 6 go to Window>Devices. Then right-click your device in the pane and open 'Show Provisioning Profiles...'. In my case, there were several repeats with varying expiry dates. Clearing out the list fixed this for me.
That was it for me (profiles.) In my case, I had to delete all, re-add the right one, reboot the device, relaunch XCode, then do 2 clean builds (the 1st one still said "time out trying to launch.") Whew!
None of the answers below worked for me, so I searched more and this genius idea worked: stackoverflow.com/a/28455173/1032900

C
Community

You are using distribution provisioning profile rather than development profile. check this link


This is correct in my case because I use ad-hoc provisioning profile.
thanks for the great tip! so obvious once you know!
A message like "possible cause - are you using your distribution profile instead of your developer profile" would save a few gray hairs.
I thought this was my xcode issue and i stopped searching for this error and finally i got my answer thanks to Ishu
T
Tenaciousd93

How to Fix:

I fix it with:

clean project (Product > Clean)

hard reset device (power button + home button)

delete app from device

close xcode

CLOSE ITUNES (itunes must be closed)

re-open Xcode and run!

I think that iTunes was the problem.

EDIT: 2017/02: Solution still Woks (Thanks to @SalGad for information).


I don't know why, but this indeed worked for me. (I wasn't using a distribution provisioning profile.)
It's definitely iTunes for my case. The moment I quit iTunes, the app could build smoothly
I did everything other than iTunes part and it worked. Strange but worked. Thanks a ton
Feb 2017 - brilliant solution :)
even though I've quit iTunes, my device is still showing the spinning sync at top of my iPhone. So I had to do a hard reset. Even disconnecting it from my mac didn't help
K
KarenAnne

I am using Xcode 6.2, running on iPhone 4 with iOS 7.1.2, the problems happen to me as well.

It turned out that the Project and Targets' Code Signing settings are different from each other! And that's what is causing the issue.

https://i.stack.imgur.com/5iLuj.png

To solve the issue, you must make sure that their Code Signing settings is the same.


Oh no... :( Now I am encountering the problem again.
I got two project source code with the same bundle identifier. The old source code is working but the new one cannot launch.
k
kas-kad

One more thing that may be a reason to launch timeout arising is that you have a lot of Provision Profiles on your device. I have about 100 of them, downloaded automatically by XCode from our team dev portal. So if your team have tons of apps and Provision Profiles, you better unlink your XCode from your Apple ID, to prevent automatic downloading for unwanted PPs. It significantly decreases app launching time.

To delete unwanted PPs from your device you have to go XCode - Window - Devices, select your device and click "Show provision profiles..." on the bottom context menu. Then you have to manually remove the profiles. Tip: use key sequences "down arrow" - "backspace", to ease the hand routine.


This was my problem. Solved by removing unwanted PPs
D
DustinB

I had this but nothing previously posted seemed to work. This is what I did to fix the issue in Xcode 6.3.2:

Go to Product->Scheme->Edit Scheme... Select the Run Scheme Select the Info tab Make sure the settings are as follows: Build Configuration is set to "Debug" Debug Executable is checked Launch Automatically is checked


No sure why the down vote, it fixed it for me. Care to explain why?
J
Jerome Thomere

In my case I was using the development profile, but somehow, in Build Settings > Code Signing, the Provisioning Profile for Debug was empty.

But before setting it to "iOS Team Provisioning Profile", I had to reset my account since it said " is Not on Any Development teams" - Xcode > Preferences > Accounts - Remove my account (click "-") - Add the account again

That fixed the problem


G
Guillaume Laurent

Note that if the app still manages to start on the device after Xcode displays this error, you can attach to the running process with Debug->Attach to Process.


U
Upendar Gareri

This warning is shown when you try to run and debug your code directly in device but you are using distribution profile in your Build Settings. To directly run the code in device and debug, you need to use development profile in your Build Settings of Xcode. After setting the development profile, just reboot your device clean your Xcode project and run again. I hope this helps !!


Yes, please check your [General]->[Signing]->profile. Set your profile at development profile, and rebuild and run on the X code.
t
tomsoft

An app should return from his initialisation procedure in less then 10 seconds, or it will be killed by the OS. This is probably because you are doing too many things in the startup phase.

Try to refactor your code to do it diffrently, by doing lazy initialisation, and only initialize what is really important before showing the first view.

It's hard to give better advice before knowing more about the app itself


Hello, thank you for your answer. No, I get that error last night, and now, after 8 hours of good sleeping, it give me the same error... I try to make a clean of the project or to close xcode but nothing change. I opened an old project and try to launch it but xcode gives always the same error. I'm trying some "windows" style solution like restart computer/ipad or close app but it seems not working...
Always nice to have people downvoting without comments!
Why would someone down vote this? Perhaps it is not the correct answer to the original question, but his point is 100% valid. If your app is slow on initialization, then it will be killed by the OS.
No. It's too simple reason to be real. I see this alert in an empty app with one controller in the storyboard
R
Ram Prateek

I have faced this issue with Xcode 6.2 and Iphone 5s with iOS version 8.3.

I get this message when I deploy the application to the device for the first time.

The work around I found was that with out unintalling the application from the device,redeploy the application from Xcode.It should run perfectly this time. I observed this only on Xcode 6.2 not on Xcode 6.3 so this might be an Xcode to iOS version compatibility issue.


d
drublu1215

Big and weird tip for this problem... this was happening to me and none of the advice helped anywhere on the web, but then i noticed if i deleted everything out of the main ViewDidLoad method it would work. I realized there was one line of code that was messing it up. It was a line that was referencing to an array of strings that was way to big. I had something like this NSString *mystring[100][1000][100]; i accidentally added some zeros and for whatever reason this problem produced the same error message that the incorrect signing gives you. So don't let your arrays or matrixes get too out of hand!


R
RainCast

Method #1:

Lock your phone, press XCode start, wait till XCode says "unlock your device to launch", then unlock your phone, it will be launched successfully, works every time.

Method #2:

If your goal is just to debug the app, here is another simple and straight-forward approach:

After the app is deployed, launch it manually. Goto XCode -> Debug -> Attach to Process ... to choose your app from the list, then debug properly.

This works well for me, and it saves lots of time. I hope this helps, thanks!