Fri Dec 08, 2017 6:03 am
My approach to this is to use git as a source code repository. Then I can develop code (edit, compile, test) on any machine, when it looks about right I check in my changes to git, then I can go to the Pi and "git pull" the new version and build it, with make, cmake, qmake, whatever.
Using a service like github or bitbucket makes this very easy. Or if you don't like to use those you can always run a git repository locally. Perhaps even on a Pi itself.
This is not just about the Pi for me. It applies to code intended to run on cloud servers or other places.
Of course one cannot test code that relies on Pi features, GPIO etc, on a Mac or PC, but that is what "mocks" and "stubs" are for, you just link in dummy versions of those interfaces that simulate some of the real interface behavior. This is a good way to go as it encourages unit testing.
Using git is very easy, mostly you end up using a few simple commands:
$ git pull
$ git add somefile
$ git commit -m "Fixed bug XXX"
$ git push
Or all of that is integrated into a decent IDE. Like Microsoft Visual Studio Code. I guess Xcode as well.
Using git has many advantages, even for small one man projects. No more saving multiple old versions of file around the place. You always know what version of what is running where. You can easily revert back to an old working version if you make a mess. And so on.
If none of that appeals, which it should, you could just set up a SAMBA share on the Pi and work on the files directly from the Mac/PC.
On the the other hand, why not just develop code for the Pi on the Pi itself?