The coronavirus disease 2019 (COVID-19) caused by the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) has resulted in widespread disease transmission, challenging the stability of global healthcare systems. Surface-enhanced Raman scattering (SERS) as an easy operation, fast, and low-cost technology illustrates a good potential in detecting SARS-CoV-2. In the study, one-step fabrication of gold-silver alloy nanoparticles (AuAgNPs) with adjustable metal proportions and diameters is employed as SERS substrates. The angiotensin-converting enzyme 2 (ACE2) functionalized AuAgNPs are applied as sensor surfaces to detect SARS-CoV-2 S protein. By optimizing the SERS substrates, ACE2/Au35Ag65NPs illustrate higher performance in detecting the SARS-CoV-2 S protein with a limit of detection (LOD) of 10 fg/mL in both phosphate-buffered saline (PBS) and pharyngeal swabs solution (PSS). It also provides excellent reproducibility with a relative standard deviation (RSD) of 7.7 % and 7.9 %, respectively. This easily preparable and highly reproducible SERS substrate has good potential in the practical application of detecting SARS-CoV-2.