The Android Auto app from Google can inform you if your USB cord is faulty

Android Auto’s latest update includes a diagnostic feature that checks to see if your USB cable or port is functioning properly. The utility, dubbed “USB Startup Diagnostics,” appears to examine whether a USB cable connects and the cable’s quality. Google suggests connecting to your automobile with the cable that came with your phone or a cable that is less than three feet long and does not “include USB hubs or cable extensions” on a support website.