If you are in your Xcode project folder and your project has both a workspace(.xcworkspace) and a project(.xcodeproj) the file then you can use following command to open workspace in Xcode from your terminal -

xed .

If your project only has a project(.xcodeproj) the file then the same command will open your project.

You can also open/edit a single file from your Xcode project without launching the complete Xcode workspace or project. Like if you want to open your Podfile then we can open using -

xed Podfile

xed was introduced in Mac OS X 10.5 with Xcode 3.0.