why xcodebuild command fails using ssh but works using vnc->terminalApp

We are seeing issue when try to run the xcodebuild command using ssh, it fails but when running the same using VNC and open terminal app, it works.

Anyone seeing the same issue. Any workaround and help is appreciated. Codesign and simulator all works well but fails when run the same commend using ssh.

Error:
found: Select a different signing certificate for CODESIGNIDENTITY, a team that matches your selected certificate, or switch to automatic provisioning.



why xcodebuild command fails using ssh but works using vnc->terminalApp
 
 
Q