Cu–Ag alloy films prepared by magnetron cosputtering were characterized by using x-ray diffraction. A two-phase nanocrystalline structure of Cu grains supersaturated with Ag and Ag grains saturated with Cu was always observed. When alloying Ag with Cu or Cu with Ag, the grain sizes decreased dramatically, and the supersaturation increased with the amount of the alloying element. On annealing, the grain sizes of the Cu–Ag films increased and the solubilities decreased. To shed light on the mechanisms in play during the phase formation and subsequent phase changes, additional in situ real-time measurements were carried out using a high-intensity x-ray beam from the synchrotron at the European Synchrotron Radiation Facility in Grenoble, France. Based on the experimental findings, the phase formation and the subsequent changes during annealing are discussed.