API for selecting iTunes library location

I'm looking to programatically set the iTunes library location to custom locations using e.g. C / Obj-C or Swift API. Alternatively, modifying plists, using the defaults CLI tool, etc, are also OK for me.


Ordinarily, selecting a custom iTunes library location is done by launching iTunes while holding down the option key. I need to be able to do this in e.g. a unit testing environment / programatically.


Any ideas?