Build on device fails with exit code 1
lock add unlock keychain solve the problem, it' weird.
Try updating Certificates from Preference -> Accounts -> Choose developer account and Proper Team -> View Details -> Download all profiles.
Also, try doing Deep clean using Cmd+Shift+Alt+K. Make sure you have selected correct developer team in your general settings.
Also, Change Provisioning to Automatic. So that it will automatically fetch proper certificates.
After that, Goto Build Phases ->Link Binary frameworks-> Add Frameworks you want. Do this for all targets that you have.
Try this and let me know if error still occurs.
Hope it helps..
I just simply restarted my MacBook Pro. I found this solution here.