The identity used to sign the executable is no longer valid.
Please verify that your device’s clock is properly set, and that your signing certificate is not expired. (0xE8008018).
So I finally managed to make it work though I'm not exactly sure which of the following had to be done.
Xcode > Preferences... > Accounts)
From what I had read on SO it should have worked here, but in my case it wasn't.
So what I did was:
Window > Devices
Show provisioning profiles...
After doing what I said above it worked.
Hope this can be helpful.