Thomas Long of 4, Churchfield Place West, Cork, had 81 previous convictions including counts for robbery. Long was stopped by security at Apple in Hollyhill, Cork, at 1am on November 15, 2015.

The security guard alerted gardaí and Long, 33, was arrested. Inspector John Deasy said yesterday at Cork District Court that CCTV of Long’s movements was examined and he entered the site through a fence and was seen acting suspiciously by various buildings on the Apple site. He did not enter any of the buildings.

Judge John King asked: “Did he co-operate, apart from saying he was looking for his dog?” Insp Deasy said Long had co-operated.

Emmet Boyle, solicitor, said: “He accepts he was there without permission from Apple. As for the dog story we will leave that without comment.”

Judge King said notwithstanding the missing dog story he would let the accused do a community service order instead of going to jail.

The judge said Long could do 140 hours of community service instead of 10 weeks in prison.