App installation failed: Could not write to the device

In Xcode 6.3, I got this error when trying to run an iOS project written in Swift on a real device.

App installation failed

could not write to the device.

I tried to clean the project and run again, but the same error occurs.

How can I fix this error?


Solution 1:

Deleting the app on the device and running the project again works for me.

Solution 2:

I did a Clean and installed my app successfully.

Product->Clean(Shift-Cmd-K)

Solution 3:

I turned off the device and turned it on again after which I did not get such error.