Rihanna came to the Los Angeles court shortly after closing arguments began, and for the first time she brought their sons, aged one and two.
Deputy District Attorney John Lewin suggested it was an attempt to manipulate jurors.
"They brought in two adorable children yesterday for closing argument," Lewin said on Friday.
"They haven't been here any other time. And you have to ask yourselves, why children that age would be here in a situation like this?
"You are not allowed to consider how this might affect Rihanna and his kids. We are all responsible for our own actions in the world."
Rihanna was sitting with Rocky's mother and sister, without the children, on Friday.
Rocky is charged with two felony counts of assault with a semiautomatic firearm for allegedly firing two shots at a former friend on a Hollywood street corner in 2021. Conviction could mean up to 24 years in prison.
Rocky's lawyers are arguing he only fired blanks from a prop gun he had picked up for security on a music video shoot.
During his closing argument, lawyer Joe Tacopina took aim at Rocky's accuser, who goes by A$AP Relli, casting him as the aggressor and an unreliable liar.
Tacopina showed the jury belligerent text messages from just before the confrontation, later deleted by Relli, where he urges Rocky to beat him up.
The prosecution had shown only Rocky's angry responses to suggest he started the fight.
"Their witness (Relli) lied to them, lied to police, and deleted the messages," Tacopina said. "He destroyed evidence."
In his rebuttal, Lewin said, "If it is a prop gun, there is no self-defence" and told jurors this could be "a five-minute verdict".
"Once you decide it's not a prop gun — and it's not a prop gun," he said, "the case is over."
During a break in the presentation, Judge Mark Arnold told Lewin to stop the references to Rocky's family.
"The manner in which you did it — I don't think it was improper," the judge said. "But you cannot mention again Rihanna being in the courtroom, or the kids being in the courtroom."