As far as I remember (it was mid 2017 when I started out) you add your Apple Id to Xcode via Preferences > Accounts and once you have that setup you then connect your phone to your Mac and you can select it as a build destination.
This link may be helpful: