Nathan Simmons, 26, was arrested after an incident reported at about 2:50 a.m. Sunday. Prosecutors did not want to give out the address where the crime occurred out of concern for the victim's safety.
A woman was sleeping on the couch at her friend's home when Simmons allegedly broke into the home, district attorney's office spokesman Omid Talai said.
The victim woke up to find a stranger standing at the foot of the couch with his jeans unbuckled and down, Talai said.
He pulled a blanket off the woman and she screamed, prompting him to run out of the home, according to Talai.
The woman realized her iPhone was missing but was able to call police with another phone.
Officers responded and were able to track the phone via its GPS system to the 1600 block of Folsom Street where they arrested Simmons, Talai said.
Simmons was charged with burglary with the intent to commit rape; first-degree burglary; and receiving stolen property, according to Talai.
He pleaded not guilty Wednesday to all charges and was ordered held on $1 million bail by San Francisco Superior Court Judge Samuel Feng over the objection of defense attorney Charles Bourdon.
Simmons will return to court on Nov. 9 for a status hearing in the case and a possible motion to reduce the bail.