McGrath, on crutches after accidentally stepping on a cricket ball and suffering a suspected ligament tear just before Thursday's toss at Edgbaston, told reporters: "I realised before I hit the ground that I was out of the match.
"I was just passing a rugby ball about with (reserve wicketkeeper) Brad Haddin. There was quite a sharp pain. To be optimistic, I'm aiming for Trent Bridge at worst."
The fourth Test starts at Trent Bridge in Nottingham on August 25.
After Thursday's mishap, McGrath was taken to hospital for X-rays which showed no fracture. Australia team physiotherapist Errol Alcott said it was impossible to say when he would be back.
He said: "How long is a piece of string? There is no normal time for this injury. It's too early to say. We have to see his reaction to the force that went through the ankle.
McGrath, man of the match in Australia's first Test win, had been helped on to a buggy by his team mates and taken to hospital before it was announced he would not be fit to play with 10 minutes to go before the toss.
"I was looking forward to today's game and hopefully continuing what I felt was some good bowling form," he said.
"It's just one of those things. I have had plenty of ankle injuries before but usually it's the left one. That's probably worse because it's your front foot, so hopefully that is a good thing."
McGrath, 35, took nine for 82 to pass 500 wickets in his career during Australia's 239-run win in the first Test at Lord's. England were far more impressive in scoring 407 at Edgbaston on Thursday after being put in.
The third Test starts at Old Trafford in Manchester next Thursday.