code: public static InstrumentsVersion getInstrumentsVersion() {
      List<String> s = new ArrayList<>();
      s.add("instruments");
  
      Command c = new Command(s, false);
      InstrumentsVersion version = new InstrumentsVersion();
      c.registerListener(version);
      c.executeAndWait(true);
  
      return version;
    }
docs: returns the version of the currently selected ( xcode-select -switch ) Xcode.