Best practices for developing on two macs?

I’m new to xcode/IOS development and have the following question; What is the recommended method to develop an app on two macs and keep my projects in sync between the two? I have an iMac and a macbook pro, I primarily use my iMac but will also be developing on my macbook when I travel.
thanks

Although it takes some time to configure, and there are potentially some costs associated with my approach, I suggest using an online source code control system. Personally, I use GitHub and I can easily switch machines as needed. The caveat is that all of my code needs to be checked in before I switch machines. Since this is a service my company already uses, the ability to keep multiple machines in sync is free.

Assuming you have space on your iCloud storage, you can also use iCloud drive to move files between macs. This is a little less sophisticated, and does not work if you code as part of a team, but if you are only doing this occasionally, then this approach is the easiest to use. Copy the project folder to iCloud drive and then copy it to the destination machine.

stealthkat that is the number 1 thing I do - I use Bitbucket mainly because it gives you unlimited private repos.

I do not bother trying to sync my developer account for Xcode - since it became much easier to just build and run on your own device I haven’t even tried, I just sign in to the developer account on each machine.

You can also put your project in Dropbox and have it synced across 2 Macs. A little easier to manage if you aren’t familiar with Git.

You can, but learn git. Everyone uses it in iOS development - it is as valuable a skill as Xcode.