He said Hemana was living with baby Cezar's mother in Mangere and was jealous of the six-month old. He would also get angry when the baby would cry.
Mr Shaw said that on one occasion, Cezar was crying and woke Hemana, who yelled and swore at the baby.
Hemana is alleged to have grabbed the baby by the front of his onesie pajamas.
"He violently punches him back and forth repeatedly before dropping him on to the bed.''
Mr Shaw said Hemana also picked Cezar up by one leg and again violently shook him before dropping him on the bed.
He said Cezar's mother, Victoria Taylor, tried to intervene. Hemana is alleged to have told her: "I don't give a f***, b****. I'll waste all of yous''.
Mr Shaw said Ms Taylor described her son as a "very different baby'' after the two incidents.
"Most of the time he was effectively lifeless and unresponsive.''
He read from a statement from Ms Taylor: "Before he was alert. He would talk away, watch TV. Now he just sits there and rolls his eyes. He looked like a dog and just sat there.''
It was about five days later that Ms Taylor took her son to hospital. Mr Shaw said she was prevented from going earlier by Hemana.
He said Hemana did not go to the hospital with Ms Taylor, told her not to mention him and to say bruises on the baby's head were caused by bumps and falls.
"In short, in anger and frustration, he gambled with Cezar's life and ultimately took his life.''
The jury of six men and six women is set to hear from 54 witnesses over the next two weeks.
The trial continues.