Ps -ef `pgrep -x Xcode` does not filter process

But this command will do the trick:

ps -ef | grep -si Xcode

Xcode 8.3.2