Shearer, 36, was released by Mansfield Town last week after making 30 appearances in 2016-17, the last of them at Colchester on 14 March.
The Scot has played in the English Football League for 10 different clubs.
"In terms of where the club wants to go, it fits in with me - I'm very ambitious," he told BBC Radio Oxford.
"I've had a lot of promotions but I still want to achieve more, so it gave me a new challenge coming to Oxford."
Find all the latest football transfers on our dedicated page.
Oxford United have signed goalkeeper Scott Shearer on a 12-month contract, with an option for a further year in the League One club's favour.