Hernandez, who became the highest-paid pitcher in baseball when he signed a seven-year, $175 million contract in February, walked one and gave up one hit - a solo home run to Eric Hinske.
In two spring appearances, Hernandez allowed two runs and three hits in five innings. He has one walk and five strikeouts.
Diamondbacks starter Patrick Corbin, in competition for the final spot in Arizona's rotation, threw four solid innings. The left-hander gave up one run, four hits, struck out two and did not walk a batter.
Arizona's Mark Teahen hit a three-run homer off Hector Noesi and Paul Goldschmidt had a hit, a walk, an RBI and scored a run.