Rapper DMX was outfitted with an ankle bracelet and put on 24/7 home detention by a Manhattan federal judge after twice skipping town without permission and failing multiple drug tests that were part of his bail package on tax charges.

The rap star, whose name is Earl Simmons, got his bail violation hearing off to bad start by not showing up on time for the 11 a.m. hearing before U.S. District Judge Jed Rakoff. His lawyer said he was stuck in traffic on the West Side Highway.

Simmons was charged last month with concealing income and avoiding more than $1 million in taxes. He was released on a $500,000 bail package that required him to stay in New York and submit to drug testing among other conditions.

He finally arrived 40 minutes late to Friday’s hearing with a small entourage, wearing a tie-dye Def Leppard T-shirt and sporting sunglasses inside the Manhattan federal court.

Rakoff said he had failed at least four drug tests for cocaine, marijuana and opiates, and had gone once to St Louis — for what his lawyer called a family emergency — and once to Chicago without permission, and blew off meetings with pretrial services officers.

Rakoff said it was probably more violations in a short period than he had ever seen as a judge. “This gives the court very little confidence that he should be released at all,” Rakoff said.

But the judge eventually relented, ordering home confinement instead of jail. He said Simmons will only be allowed to go to meetings with his lawyer, and otherwise will need the judge’s permission.

“Only if I agree in advance can he even go outside to water the lawn,” said Rakoff, who also ordered Simmons to participate in a drug-treatment program devised by pretrial services officials.

When Simmons left court, he embraced members of his crew and told reporters, “When God is with you, who can be against you?”

Supporters then got into a small shoving match with reporters in an effort to keep them off Simmons’ elevator. Simmons later apologized to one female reporter.