Donald Calvaire, 29, allegedly used a pocket knife to stab a 21-year-old woman in the chest around 9:07 a.m. Tuesday after she arrived at the Ashmont MBTA station.
Calvaire was held on $25,000 cash bail Thursday with orders to stay away from the victim and Ashmont Station if he posts that amount, and must also wear a GPS monitoring device if he is released pending trial.
He is set to appear in court again on Aug. 6.
Transit police used surveillance images to track down Calvaire at the Lemuel Shattuck Shelter in Jamaica Plain, where he was arrested around 4:30 p.m. Wednesday.
"The good investigative techniques utilized by the transit detectives and the information obtained by the community allowed us to make a quick arrest," said Superintendent-in-Chief Joseph F. O'Connor.
The knife was not recovered, but investigators did find several pieces of paper Calvaire allegedly threw at the victim, including a piece of mail addressed to one of his family members.
Transit Police detectives were able to search a database using that information, soon leading to his photo and Transportation Access Pass information.
Cavalaire allegedly identified himself as the person depicted in surveillance images assaulting the victim, but denied using a knife.
O'Connor said Calvaire did not know the victim, and the motive for the attack is still unclear.