The robbery was reported at about 8:25 a.m. near the intersection of Chenery and Carrie streets.
The 27-year-old victim was approached by two suspects who grabbed the phone and headphones and ran away, according to police.
When the victim gave chase, one of the suspects hit him in the head with the gun and the other punched him in the face, police said.
The suspects fled and had not been arrested as of this morning.
The victim suffered minor injuries but was not hospitalized, according to police.
Anyone with information about the robbery is encouraged to call the Police Department's anonymous tip line at (415) 575-4444 or send a tip by text message to TIP411.