I got the same warning"command codesign failed with a nonzero exit code"
my project can not run on Simulator but totally ok on my real machine.
I tried " product -> Clean Build Folder". And it looks working for me.(OOPS, Just realized you said did it too and not working for you. rip.)