As Mr. James was taken into custody more details emerged about a life that included numerous arrests.
He was born in New York City in 1959, according to public records, and his sister, Catherine James Robinson, said that he moved frequently between cities.
Police officials said that he was arrested nine times in New York between 1992 to 1998, on a number of charges including possession of burglary tools, a criminal sex act and criminal tampering. He was arrested three times in New Jersey, the first in 1991, the most recent in 2007.
In filling out a portrait of Mr. James, detectives have focused on dozens of videos they say he posted on YouTube in which he delivered bigoted rants tied to current events.
In some, he commented on New York’s subway, criticizing Mr. Adams’s policies to address homelessness on public transit as ineffective and speculating that the mayor could not possibly stop all crime in the system. In others, he mused about violent acts and alluded vaguely to the possibility of committing them.
Inside the jacket Mr. James discarded on the subway platform at 36th Street, investigators found a receipt from a storage facility in Philadelphia, where he rented an apartment for about two weeks starting at the end of March, according to the federal criminal complaint.
When they searched the storage unit and his apartment on Tuesday and Wednesday, they found handgun ammunition, a Taser, a high-capacity rifle magazine and a smoke canister, the criminal complaint said.
Reporting was contributed by Jonah E. Bromwich, Troy Closson, Michael LaForgia, Ana Ley, Chelsia Rose Marcius, Andy Newman, Rebecca Davis O’Brien, Sean Piccoli, Michael Rothfeld, Nate Schweber, Ashley Southall, Ashley Wong and Karen Zraick.