Is there an approach to querying the local iTunes library to remove apps that aren't currently installed on any of your devices?
I might suggest a really wild -- possibly dangerous -- approach. If you have a good backup, it is less dangerous, but until you have restored from that backup there still can be snags and problems in a restore that you want find until that point. The good news is you don't need the backup, it's just there I case a crash happens in the middle of this process.
- First make sure you've got a good backup of your iTunes library.
- Then delete all your apps from iTunes.
- Finally, sync each of your iDevices and when it tells you it found apps on the iDevice(s) that were not in the library, make sure you tell it to restore them back to the library.
You should end up with only those apps that are installed on at least one iDevice! (In theory, at least.) And if anything fails, restore the library from its backup.
This worked for me without any issue:
- Connect you iDevice to computer, let the sync complete (or cancel as per your choice)
- In the iTunes app library, select all (CmdA) and delete. on the prompt select Move to Recycle Bin.
- Do not sync now, go to Files>>Devices>>Transfer Purchase from "Your iDevice"