Tense protests that erupted in Richmond, Virginia, and Philadelphia were matched by largely peaceful protests in cities from Brooklyn to San Francisco.