Although one typically opens Xcode from the Dock or Applications folder, there are times calling Xcode from with a script (shell/terminal) can be helpful.
xed – Xcode text editor invocation tool – offers a number of options when opening xcode, from a terminal enter the following to get a list of the command line parameters:
The output below shows the options available to start xed:
-x, --launch Just launch Xcode with a new untitled document.
-c, --create Create the files if they do not exist.
-w, --wait Wait for file to be closed by Xcode.
-l, --line <number> Select line <number> after opening file.
-b, --background Leave Xcode as a background app after opening.
-h, --help Show this information.
-v, --version Print version information.
You can also enter man xed to get more information about the parameters above.