Xcode 14 no longer puts the Rosetta expanded shared cache under 16.0. Instead, it includes the real version number (e.g. 13.0), the build string and the architecture, similar to the device support directory names for iOS, tvOS and watchOS.
Currently, when there are multiple directories, we end up picking the wrong one in GetSDKDirectoryForCurrentOSVersion. The problem is that without the build string we have no way to differentiate between directories with the same version number.
13.0 (22A111) x86_64/ 13.0 (22A222) x86_64/ 13.0 (22A333) x86_64/
This patch fixes the problem by using GetOSBuildString which, as the name implies, returns the build string if it's known. For the host platform this returns the host build string while for a remote platform this returns the remote build string.
I added a Rosetta test and verified that this doesn't break remote ios debugging.
rdar://97576121
Why not add this to decorators.py ?