Applying supersymmetric localization for superstring worldsheet theory with N = (1, 1) supersymmetries on a cylinder and with arbitrary boundary interactions, we find the most general formula for the Ramond-Ramond (RR) coupling of D-branes. We allow all massive excitations of open superstrings, and find that only a finite number of them can contribute to the formula. The formula is written by Quillen's superconnection which includes higher form gauge fields, and the resultant general Chern-Simons terms are consistent with RR charge quantization. Applying the formula to boundary string field theory of a BPS D9-brane or a D9-antiD9 brane system, we find that any D9-brane creation via massive mode condensation is impossible.