I came up with a procedure that leaves all data on the iOS device intact. All changes are only on the Mac side - nothing on the iOS side.
Disclaimer: This procedure requires use of the Unix command line. If you are not familiar with this you should learn about it before you attempt this. This procedure also removes several important configuration files that will be rebuilt in their default state. You should make sure you have a complete backup of you Mac including your home directory and iTunes directory - *and* know how to restore it should you need to. Also make sure your iOS devices are backed up to iCloud. By the way I ran this on macOS 10.12.2 and iTunes 12.5.4.42.
This procedure worked for me (on two different Macs with 3 iOS devices). However YMMV. Also this procedure probably removes more files that are absolutely necessary, but I didn’t want to take the time to figure out exactly what combination of files would cure the problem. Please review the entire procedure and proceed at your own risk.
Preparation:
Close all applications and log out.
Log in to another account on your Mac with Administrator privileges. Create a new account if you don’t already have one.
Open a terminal window. Create a shell under your original user with the command:
sudo su -l <user>
Where <user> is the short user name of the original account that you normally log into (not the one you are using for this procedure). This will prompt for the password of the current account.
Verify that the HOME variable is pointing to right place:
echo $HOME
This should be /Users/<user> where <user> is your short login name of your original account (same as in the ’su -l’ command).
Create a temporary directory to hold some files (you can use whatever name you like):
mkdir Hold
Part 1:
Verify that SyncServer is working normally. If not you need to fix it first. Look in '/var/log/system.log' for messages like:
… com.apple.xpc.launchd[1] (com.apple.syncservices.SyncServer): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
These messages occur at the same time you connect your iOS device and get the “…syncing has been disabled on this computer...” message.
If you see these messages then you need to fix SyncServer before proceeding.
Look at the file '$HOME/Library/Logs/Sync/syncservices.log'. You will likely see messages that contain:
"Can't upgrade SyncServices data schema in directory”. If you see this, you will need to get a clean copy of the directory: '$HOME/Library/Application\ Support/SyncServices/Local/'
I was able to copy this from my account on my laptop. I believe you need to have another account somewhere that is signed into iCloud with the same AppleId as iTunes in the original account with the syncing problem.
I used 'rsync -aE ...' to copy the Local directory into the target account into a the Hold directory above and then moved into the $HOME/Library/Application\ Support/SyncServices/ directory. I did this because rsync has trouble with directories with spaces in the name. This will look something like this as executed on the Mac with a good copy:
cd $HOME/Library/Application\ Support/SyncServices/
rsync -aE Local <user>@<target-mac>:Hold/
Where <user> is the short user name of the account with the problem and <target-mac> is the network name of the Mac with the problem.
Example: from another Mac (user: fred, machine name: imac) with a good '$HOME/Library/Application\ Support/SyncServices/Local' directory:
cd $HOME/Library/Application\ Support/SyncServices/
rsync -aE Local fred@imac:Hold/
Then on original Mac: mv $HOME/Hold/Local $HOME/Library/Application\Support/SyncServices/
After you have repaired SyncServices, you can verify that it is working by logging into your original account and connecting your iOS device. The message described above should no longer occur in ‘/var/log/system.log'. Make sure this is working before you proceed.
On the off chance that you no longer see the “…syncing has been disabled on this computer…” when you plug in your iOS device, you should stop here and see if syncing is working now. Assuming you are still seeing that message proceed to the next step.
Part 2:
Log out of your account and log into the other account as above. Open a terminal and use 'sudo su -l <user>' to get a shell with the right home directory as above.
Move the following files to the backup folder (don’t worry if there any are missing):
mv $HOME/Library/Preferences/com.apple.iTunesHelper.plist $HOME/Hold/
mv $HOME/Library/Preferences/com.apple.iTunes.plist $HOME/Hold/
mv $HOME/Library/Preferences/ByHost/com.apple.syncservices.*.plist $HOME/Hold/
mv $HOME/Library/Preferences/ByHost/com.apple.syncservices.*.plist.* $HOME/Hold/
mv $HOME/Library/Preferences/com.apple.syncserver.plist $HOME/Hold/
mv $HOME/Library/Preferences/com.apple.syncserver.plist.* $HOME/Hold/
mv $HOME/Library/Preferences/com.apple.syncservices.*.plist.* $HOME/Hold/
mv $HOME/Library/Preferences/com.apple.syncservices.*.plist $HOME/Hold/
mv $HOME/Library/Preferences/ByHost/com.apple.iTunes*.plist $HOME/Hold/
mv $HOME/Library/Preferences/ByHost/com.apple.iTunes*.plist.* $HOME/Hold/
Download a fresh copy of iTunes and install it (still in the other account). This will make sure all of the system iTunes files are current.
Log off and restart the Mac immediately after installing iTunes.
Log in as normal to your original account. When you open iTunes you may see an empty library of you have your iTunes library in a non-standard location. If this happens, quit iTunes, then open it again while holding the option key down and iTunes will ask you to choose the folder that contains your iTunes library. The folder you choose should have the 'iTunes Library.xml’ file in it.
Once in iTunes you will need to sign into the iTunes store again. You should also review all the iTunes Preferences to make sure none have been lost. You are now ready to connect your iOS device and sync as usual. All of your iOS device sync settings should be intact.
If you go through all of this - let me know if it works.