Xcode process launch failed: Security - ios

I have been developing an app for 1 or 2 weeks now and just yesterday I have updated my iPhone 5S to the iOS 8 GM. Everything worked fine and I could test on my device as well until I deleted the app from my phone and wanted to build again. The following error appeared:
Could not launch "My App"
process launch failed: Security
When I test with the simulator it works fine.
Is this because of the iOS 8 GM update and how can I fix this launch problem?
I want to be able to test on my iPhone and in the simulator.

If you get this, the app has installed on your device. You have to tap the icon. It will ask you if you really want to run it. Say “yes” and then Build & Run again.
As from iOS 9, it is required to go to Settings → General → Device Management → Developer App → Trust`.
On some versions of iOS, you will have to go to Settings → General → Profile instead.

Updated answer for Xcode 7: Tapping the app no longer works (as of beta 1 it just displays an "untrusted enterprise developer" message with only a Dismiss button).
To fix, open the Settings app, go to General / Profiles, and you'll see your profile. Mark it trusted and things should start working normally again.
Updated For iOS 9.2.1 and Xcode 7.2.1:
Goto: Settings > General > Device Management > Select App from Developer Apps > Trust App.

Hey so the accepted answer works, except if you need to debug the initial launch of the app. However I think that answer is more of a work around, and not an actual solution. From my understanding this message occurs when you have some weirdness in your provisioning profile / cert setup so make extra sure everything is in tip-top shape in that dept. before ramming your head against the wall repeatedly.
What worked for me was as follows from the apple docs:
Provisioning Profiles Known Issue If you have upgraded to the GM seed
from other betas you may see your apps crashing due to provisioning
profile issues.
Workaround:
Connect the device via USB to your Mac
Launch Xcode Choose Window ->Devices
Right click on the device in left column, choose "Show
Provisioning Profiles"
Click on the provisioning profile in question
Press the "-" button Continue to removing all affected profiles.
Re-install the app
Make sure you right click on the image of the device not the name of the device or you won't see the provisioning profiles option. I restored my new phone from an old backup and there was a lot of cruft hanging around, i also had 2 different dev. certs active (not sure why) but i deleted one, made a new profile got rid of all the profiles on device and it worked.

Update for iOS9.2.1 and Xcode 7.2.1
If you get this error when building to a device in Xcode:
On your device, tap the app icon that would have just been added from your attempt at building the app and you should see this:
Next, on your device, go to Settings --> General --> Device Management, and you will see this page:
Select the profile you are using with Xcode, and you should see this page:
Click Trust "username#email.com" then click Trust on the next popup.
Go back to Xcode and re-run your project and it should build the app to your device.

To get around the process launch failed: Security issue and immediately launch the app on your device, tap the app icon on your iOS device after running the app via Xcode.
This will allow you to immediately run the app. It may not actually "fix" the root issue that is causing these permission alerts.
Be sure to tap the app icon while the Xcode alert is still shown. Otherwise the app will not run. I continually forget this vital step and am unable to run the app on my device. Thus I am documenting it here for myself and everyone else :)
Run the app via Xcode. You will see the security alert below. Do not press OK.
On your iOS device, tap the newly installed app icon:
After tapping the icon, you should now see an alert asking you to "Trust" the Untrusted App Developer. After doing so the app will immediately run, unconnected to the Xcode debugger.
If you do not see this "Trust" alert, you likely pressed "OK" in Xcode too soon. Do not press "OK" on the Xcode alert until after trusting the developer.
Finally, go back and press "OK" on the Xcode alert. You will have to re-run the app to connect the running app on your iOS device to the Xcode debugger.

Go to SETTINGS -> GENERAL -> Profiles & Device Management
and choose the developer profile, then push Trust.
if you do not have Profiles & Device Management menu, you have to enroll your device on beta.apple.com and download the profile from Safari.
Install the profile
Restart your device
Tap on the developer profile and trust.
You are all set.

I have the same issue. I click ok in xcode and when launching the app on my iPhone I'm asked if I want to trust this application. Doing it, the app runs and further build-and-run from xcode went without any issue until deleting the app from the iPhone and reinstalling it. Then goto first line ;-)

Alternatively if one does not see "Untrust App Developer" dialog:
Go to your iPhone > Settings > General > Profile > "you#email.com" > Trust

In iOS 9.2 they renamed the 'Profiles' to 'Device Management'
This is how you should do it now:
Settings -> General -> Device Management
Verify the app

Ok, this seems late and I was testing the app with the Internet connection off to test my app for some functionality. As I turned off the Internet, it gave me such an error. After I turned on the Internet, I could install it again. I know this is silly but this might be helpful to someone.

I had this issue before on Xcode 7. Then I realized it's all about my Internet connection: it was down, and the security check was using the
Internet to make sure your developer account is correct. And when it saw no Internet it gave this error … after I have fixed my Internet, it works well.

Xcode is able to build and install the app, but isn't able to launch it the first time. You just need to tap on the app's icon on the phone, then you will be prompted to ask if you want to trust the developer. Allow it and the app will launch, then Xcode will be able to automatically install & launch this and your other apps.

"If you get this, the app has installed on your device. You have to tap the icon. It will ask you if you really want to run it. Say “yes” and then Build & Run again."
To add to that, this only holds true the moment you get the error, if you click OK, then tap on the app. It will do nothing. Scratched my head on that for 30 odd minutes, searching for alternative ways to address the problem.

BTW, this also happens if you change the team of your target in Xcode and rebuild. Was quite puzzled to see that problem with an app that I had run on the device before. Took me a while to figure out…
Might only happen the first time building to a device with a team, though.

Related

Could not run build/ios/iphoneos/Runner.app on Try launching Xcode and selecting "Product > Run" to fix the problem

When running an iOS App on a real iPhone (not Simulator) you may run into this problem.
The reason is because the app isn't signed by a trusted source.
To fix this you have to Open Settings on your iPhone and navigate to: General -> Device Management, then select your Developer App certificate and "trust" it.
Update: it may now be called General -> VPN & Device Management
Same issue happened with me.
Device : iPhone XR and iOS version: 15.4
Open Settings > Developer
Click on Clear trusted computer
Then click on trust this computer
Same issue here, I only solved it after uninstalling the app and run it again.
Go to your device Settings
Go to General
At the bottom you may find Transfer or Reset iPhone option,
select that. (Be careful selecting anything here)
Now choose Reset option and select Reset Location & Privacy.
(Enter your pin to confirm. After few second it will prompt the trust
this computer option.)
In Shortcut you can go Settings>General>Transfer or Reset iPhone>Reset>Reset Location & Privacy or directly search for Reset then choose Reset Location & Privacy
Now you will find the previous trusted app in Device Management. Please remove if you have same. Now re-run
The following steps worked for me:
open the xcode
select your device
run build (sure you have signed your team first)
trust for this developer
Xcode was configured with an ad hoc profile instead of a dev profile, changing that fixed it.
On iPhone 7 going to Settings and clearing trusted computers with further build clean did the trick for me
I ran into this issue when I had a very low wifi connection. The low connection would cause this issue intermittently. Fixing the wifi connection fixed this issue for me.
(In my case, I needed to reset my wifi settings on my iPhone).
I had this issue when I tried to install a different version of the same app (store and dev). All I needed to do was to fully uninstall all versions of the app from the target iPhone. Might not work in every case, but easy to try.

Fixing Xcode 9 issue: "iPhone is busy: Preparing debugger support for iPhone"

I'm looking for more information on the message below. Xcode 9 seems to be hanging for a couple minutes already...
How can I tell Xcode 9 to quickly recognize my previously used device updated to iOS 11?
.Alex’s iPhone is busy: Preparing debugger support for .Alex’s iPhone
Xcode will continue when .Alex’s iPhone is finished.
There are multiple solutions for this:
Solution 1: Patiently wait for 10 to 15 minutes. Have a tea or roam around ;-)
Solution 2: Disconnect device from the system. Restart both iPhone and Xcode and then rebuild again.
Solution 3:
Go to Windows → Devices and Simulators (Shortcut key: cmd+shift+2)
You’ll see iPhone device connected to system with message
iPhone is busy: Preparing debugger support for iPhone
Click on plus button (+) present in bottom-left corner.
This will show the device connected to system. Click on Next button.
Thereafter you’ll see ‘device setup was successful’. Click on Done button.
Solution 3 worked for me!
Solution 4:
Unpair your device and then pair it again. Thereafter follow Step 3.
I clicked ‘Cancel Running’, opened the Devices list, unpaired my iPhone, removed my USB cable and reconnected it, paired the iPhone, and then was asked on my iPhone to enter my passcode ("pin code"). Did this and then was finally able to pair my phone correctly.
Wait a few minutes. The application will start automatically
Restarting Xcode worked for me (quit and start again).
What didn't work for me:
waiting for an hour on one device
waiting for an hour on another device
restarting devices
unpairing/pairing devices
It turns out XCode opens device manager window beneath it and waits for you to hit the next button. Switch to that window, hit next and you get the progress bar for the process to show up.
In my case, iTunes was open, so
1 - open iTunes
2 - access you phone
3 - click to disconnect your phone
Now the device is ready on XCode
Hope it helps....
below solution worked for me, follow steps to resolve your issue:
Step 1: Cancel Running
Step 2 : open Window menu and select Devices and Simulators
Step 3 : Unpair the iPhone
Step 4 : Removed iPhone USB cable and reconnect to the system
Step 5 : Pair the iPhone when you connect then you will be asked to Trust or Don't Allow, Please click Truct on your iPhone and enter your passcode (Pin Code)
Note : I performed all the above steps they worked for me. The issue of my device debugger gone.
Below is the Screenshot of Devices and Simulators Menu
I unplugged my cable and saw this. After it reached the end I was able to run it no problems.
You don't have to unplug to see this; just hit cancel and you will see its progress.
On your iPhone:
Settings > Developer > Clear Trusted Computers
Wait a few seconds, it's all.
Click on Window menu
Select Device and Simulators
Select your device
Click on + button at bottom left corner
Click Next
Click Done
I found deleting the app from the device and re-installing with Xcode solved this issue.
I have been using my iPhone X to debug via Network and suddenly had this problem.
Disable "Connect via network" and try again with USB.
This trick worked for me.
I realised I had less than 100 MBs of free space on my disc. Freeing up disk space solved the issue for me!
Simple solution:
Open Window -> Devices and Simulators
Unpair iPhone on the side list
Unplug and plug again the USB cable
Press Trust in the prompt message in the device!
Then it should work! It worked for me
I had the same problem many times, these things worked for me:
restarting my phone + xCode.
checking that both your Mac and your iPhone are connected to the same Network.( has a high potential ).
repairing my phone.
When you plug a New device which is having iOS 11, Xcode 9 will Prepare Debugger Support for that device, At this time you should Wait to complete it.
Then run the project in that device it will run smoothly.
If you didn't keep patience while creating Debugger Support then it will throw the error mentioned in the question.
My setup
macOS 10.14.6
iOS 13.2.3
Xcode 11.2
Tried all the "speedrun" tips up till 2019-11-24 without luck.
The wait seemed inevitable but incredibly long in my case:
with a freshly upgraded iOS version.
I then found this comment on reddit which makes the most sense:
This is required when you connect a device with an iOS version that
the respective computer's Xcode didn't see before. It saves them in
/Users/username/Library/Developer/Xcode/iOS DeviceSupport and it does
take a while. Don't restart Xcode as it will not help you, just wait
for it to finish.
It takes quite some time because these debugger
support files occupy a lot of space (29 GB for me), though you can
safely delete any version from there, and if you connect a device with
that version again, it will re-save it from scratch.
So if you just upgraded your iOS, then the "from scratch" part could take longer than usual, also depending on your network condition. In my case, it is definitely much much longer than the "10-15min" other people claimed. I measure it by hours.
A lot of tricks seem to have worked but they neglect the fact that time goes on as you try things while Xcode keeps working on the setup in the background, and quite possibly resumes its job whenever you do a restart/reboot cycle.
This led me to noticing that my Xcode version is just one step behind the iOS point release. After upgrading my Xcode, it worked.
But it took longer because I removed the iOS DeviceSupport folder by following a tip!
So here are my suggestions:
Check your Xcode version down to the minor version to make sure it should actually support the iOS version.
Check your Mac's free disk space to make room for newly generated device support content under ~/Library/Developer/Xcode/iOS DeviceSupport as this tip suggested.
Check if you have connected your device to a fast-enough USB port, as this tip suggests.
Wait till Xcode finishes "preparing for debugging".
If it doesn't finish in a few seconds or minutes, keep waiting.
DO NOT remove any folder as some tips may suggest. Removal would simply make you wait longer!
The Best way:
Disconnect the Iphone.
Clean xcode by command+ shift + k or by going to Product -> Clean
Connect again
Run again
rebooted iPhone, closed all other open applications and unlocked phone worked
Clean : Shift-Command-K is what works for me.
For me it Worked after following the below steps
Step-1 Go to Devices and Simulator
Step-2 Deselect Show as run destination and Connect via network Options
Wait for Few seconds to Load the Xcode, If you want you can restart Xcode also.
Step-3 Follow the same steps and got to Devices and Simulators
Tick back both the options and it will be normal to install your app back.
Do this Two Task to solve your problem:
First Go to Xcode then -> Preferences -> Accounts then below click the plus icon to add apple id it must me same as your iphone device apple id.
Second Just change the cable if first solution can not work
I updated to iOS 11.0.3 then the error appeared. After restarting my iPhone and XCode, it showed "Could not launch the app", so I navigated to the phone's device management to trust, then it solved.
I had this problem because I hadn't given iTunes permissions to run on the computer. (I don't use iTunes for music, so I had foolishly just hit "decline" in annoyance whenever the EULA dialog box came up.)
Unpaired my iPhone
Removed my USB cable and reconnected it (Do make sure that you unplugged the USB and plugged it back in)
Paired the iPhone.
(3 important steps)
Xcode 10.3 Solution
The following error messages apply:
iPhone is busy: Preparing debugger support for iPhone
Xcode will continue when iPhone is finished.
An error was encountered while attempting to communicate with this device. (The service is invalid.)
Please try rebooting and reconnecting the device. (0xE8000022).
Follow the steps in Jayprakash Dubey's post above
and
Close Xcode;
Delete contents of DerivedData folder ~/Library/Developer/Xcode/DerivedData
Restart Xcode & iPhone
Pair Xcode & iPhone again
& run application
Today, I have faced the issue and tried out everything mentioned here and different pages as well. Nothing worked for me.
Lastly, I have reset the iPhone, then tried building the application and finally it worked for me.
I updated my iPhone to the latest version 11.0.3, then restarted my iPhone. Restarted my XCode 9. Then it worked.
For those looking for solution with Apple TV, I just experience the exact problem "Apple TV is busy: Preparing debugger support for Apple TV” with Apple TV 4K with my Macbook Air (Early 2015)
The solution is not to unpair or restart devices. But to switch network. I brought it to a faster and more open network and it works perfectly.
TL;DR: Settings > General > Profile & Device Management > (Under DEVELOPER APP category) click my email address that happens to be my Apple ID > Trust Developer
This might not be relevant to anyone else, as I am new to iOS development and this was my first attempt to install an application on my phone, but I'll provide the answer as it wasn't yet listed.
I went through restarting my phone, restarting Xcode, unplugging and plugging back in, clean building, and even removed the device from the Devices and Simulators menu. However, I believe the cause for me was that I hadn't added my developer certificate to the listed of trusted certificates on my device.
I am on iOS 10.3.3 so the navigation and wording in Settings on the phone might be slightly different, but the final step I took before this issue was fixed was to trust my developer certificate as an individual developer on my phone.
To do that, go Settings > General > Profile & Device Management > (Under DEVELOPER APP category) click my email address that happens to be my Apple ID > Trust Developer
Whether or not that was the cause of my problem, I am unsure. This was, however, the last step that I took before the app ran on my phone successfully after doing all of the other steps listed above.

Increase timeout when launching iOS app on device from Xcode [duplicate]

I am trying to launch my app on device. It is launching successfully on the simulator.
List item
I use 7.1 SDK
Xcode 5
And the device is a 7.1 iPhone 4S
I have tried:
Clean
Clean Build Folder
Deleting app
Disconnecting/Reconnecting device
Booting device
restarting Xcode
What can I do to make it work?
Could it be something with Code Signing?
Currently i have it set to 'Dont Code Sign'
I had this problem when I used a Distribution certificate instead of Developer one when running the app from Xcode. You may check it out your target --> Build Settings --> Code signing.
As #AndyDynn pointed out in his comment:
Make sure you do this on the "Target" build settings and not just the "Project" build settings.
I literally restarted my iPad, that was connected for testing the app, and that resolved the issue.
To run your app on a device, you will perform these tasks that follow:
Request a development certificate.
Add your device to the portal.
Code sign your app.
Launch your app on the device.
For more detail check this
If your provisioning profile and code sign everything is alright then try once Quit and Restart your XCode. It will work for me.
I just had this issue.
I had to open the app on device and tap Trust Computer.
No need for me to reboot everything 20 times, yay.
Below are 2 awesome hacks that have not been mentioned yet:
HACK #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.
HACK #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!
I got the same problem and after looking at the answers here I found mine. The issue at hand was: my dev distribution certificate was gone from iOS Dev Center, so I just assume it had timed out. I didn't get a nice warning though, just the above error - installing worked but debugging didn't. So I had Xcode regenerate a new one for me.
One more thing to try if you've tried the above:
i found this link about quitting itunes to avoid the timeout. This works for me with xcode 5.1
In my case there was no value at Targets -> Build Settins ->Provisioning Profile. Though Code Signing looked ok)
I cleaned out my provisional profiles, rebooted the iPhone, rebooted the computer, and it worked for me.
Just to throw out an additional suggestion to anyone coming across this problem (it's been burning me frequently lately) -- try going to the Targets -> (Your Target) -> General -> Team and re-selecting the same Team, which forces Xcode to update profiles for you.
That has been the culprit for me a couple of times. Seems to happen specifically if you've recently re-downloaded a distribution certificate for new devices or w/e. Or if you've just dumped your Provisioning Profiles directory in general.
I had the same problem and I tried all the suggested steps but I managed to get it deployed and run only after I powered off my iphone.
Checked my Targets and code signing details, didn't help. I did three things:
Clean Build Folder
Close Xcode and delete everything in Derived Data
Rebooted my device
Everything worked fine after that. I had changed some App Transport Security setting in my info.plist right before this occurred. Not sure if it is related or if only one of my 3 steps were necessary, but it worked.
Make sure the Provisioning Profile setting in your environment is set to your development profile: Project > Build Settings > Code Signing
Consider setting it in your Target settings and the Pod project (in case using Cocoa Pods).
In case the development profile is not present create or download it:
Certificates, Identifiers & Profiles > Provisioning Profiles
After following the above, it still didn't work (from xCode 6). But after rebooting the phone and deleting the app, it worked.
Check Product Name for dots "."
"." are not allowed in Product name.
Selection in provisioning profiles may cause this problem. So while launching an app on to the device, make sure you are using the development profile & not the distribution profile. I have been facing the same issue. But got away with it using the same process.
Check for Project > Build Settings > Provisioning profile & select your development profile.
And also take care of Code Signing Identity in the same tab. Make sure you choose both the identities of Developer & NOT of Distribution.
Below two steps solved for me:
For xcode version: 7.2
1.Select any of your simulator to run ( just start your run, no need to load the app completely).
2.Stop it.
3.Then select your device and run.
This solved in my case.
option + command + shift + k and then run the project did the trick for me.
If your goal is to just launch the app and debug it, you can also edit the schema to "Wait for executable to be launched" and run the app manually.
The setting is under Edit schema > Run > Info > Launch. Choose "Wait for executable to be launched" instead of "Automatically". It will wait for you to run the app (by manually tapping it) instead of timing out.
As all of the above answers didn't helped for me I'll publish my solution:
Deleting all the occurrences of xcuserdata folders in .xcodeproj and .xcworkspace and restarting Xcode fixed the problem. To delete it right click your_app_name.xcodeproj and/or your_app_name.xcworkspace in your app folder and select "Show Package Contents". I hope that help someone to save some time.
Just restart my Device and works everything fine
I tried:
Restart the device (iPhone)
Clean build the XCode project
Then it works.
Check whether the device memory is full.

Cannot verify client 3000

I am using xcode 7.1 and trying to upload my app to the app store directly through xcode. While uploading I am getting a weird error:-
cannot verify client 3000
Note:- I recently made changes in the accounts (xcode preference section). Is this related to my error?
I also restart the xcode but issue still there?
I already checked this question on SO, but they say restart your xcode. But this does not solve my problem.
For my case,I got this error after selecting "Generic iOS Device" when archiving, however i plugged in my iPhone and selected it, then archived, I got no errors this time.(I also cleaned both Shift+cmd+k and Shift+alt+cmd+k before archiving)
I encountered the same issue the first time I tried to submit to app store with the target on my device.
What worked for me:
I retried a couple of minutes later without changing a thing and everything went smooth.
This is temporary apple server bug. Try it again OR Retry after some time it will fix the problem.
Thanks
There is no need to reinstall Xcode. Just wait a few minutes and try again and it will work.
I tried :
waiting days,
restarting,
deleting the developer account in
preferences,
submitting archives from a connected device,
submitting
archives from a iOS generic device.
Nothing worked.
I needed to:
create an archive (it was from a connected device),
in the organiser window select the export button (on the right hand side underneath the "Upload to App Store" button.
Select that the export is for app store distribution.
Wait.
Take a note of the location the .ipa file is saved to.
Go back to Xcode, then select the menu item Xcode > Open Developer Tool > Application Loader.
Select Deliver Your App, and select choose.
Navigate to your .ipa file noted above.
Select next, wait, next, check for any error message, send.
Hope this helps someone.
I got this error while uploading my distribution archive to App Store with selecting Distribution provisioning profile scheme -> Product -> Archive -> Upload to App Store. The error is based on I chose my real iphone device in Xcode by mistake. You need to choose "Generic iOS Device" and repeat same steps as I mentioned before.
You have to plug in your iPhone to your Mac and try to upload to AppStore again.
For some reason, validating the archive before uploading fixed the issue for me.
With Xcode 7.1, I could only make a successful build without bitcode. Try it out if everything else fails.
I resolved this by exporting ("export" in xcode archive organizer -> "to iOS App Store") and using the Application Loader instead of xcode to submit.
It is recurring. Seems to me like an internal error with apples identification service or so.
My definite solution:
Get yourself a cup of tea and try it again.
You can, of course, do some voodoo or change the target device or something, but re-trying after a while will do.
I have the same issue.
I did the below steps:
Step 1: Select Code Signing Identity for "Release"
Step 2 : Select Distribution profile
I tried to use Application Loader instead and it worked well. Maybe that helps
I've been having this problem since Xcode 7.1 (for more than a month). I did everything I could trying to solve this: restart Xcode, clean project, clean build folder, build with a device connected, reinstall Xcode multiple times, even formatting the whole disk and starting from scratch. None of this worked.
During this time my colleague was always able to upload the very same builds to App Store without any problem.
Curiously, what solved this problem for me was disconnecting my non-Apple wireless mouse.
I found this out when I tried to submit an app from my home computer and got the same error. I disconnected the mouse dongle, tried again and it went through.
I've verified this three times both on my home (MacBook Pro 2013) and work computer (Mac Mini 2014).
This leads me to believe that during the app submission process Apple may check if your environment is purely made by Apple or not, and may block your submission based on that. This would explain the "Cannot verify client" message.
This one worked for me:
Delete the Archive that failed during upload.
Clean the solution.
Rebuild the solution.
Archive the it.
Go to Xcode's Organizer, then Validate (this should be 'Successful').
Upload the build.

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.
You are using distribution provisioning profile rather than development profile. check this link
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 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.
To solve the issue, you must make sure that their Code Signing settings is the same.
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.
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
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
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.
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 !!
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
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.
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!
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!

Resources