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.