McAndrew smashed an unbeaten 56 off 59 balls in an unbroken eighth-wicket stand of 78 with Daniel Drew (208 not out) as SA declared at lunch on 7-438.
After Wes Agar (3-22) made the initial incisions, McAndrew (3-26) stepped up to leave WA foundering at 6-65 at tea, still 373 runs behind.
Agar started the collapse having Sam Whiteman (0) caught behind and then bowling Shaun Marsh (1) as the visiting team slumped to 2-5.
McAndrew chipped in by dismissing Hilton Cartwright for five, but Cameron Bancroft and Aaron Hardie each scored 27 and temporarily steadied the innings with a fourth-wicket stand of 42.
The innings subsided just before tea, with WA losing 3-0.
McAndrew struck with successive deliveries, bowling Bancroft and trapping Josh Inglis lbw for a golden duck.
Agar followed up In the next over winning a lbw decision against Hardie.
Earlier in the day, Drew accumulated 25 boundaries in his 345 ball innings, which far exceeded his previous best first-class score of 130.
Paceman Charlie Stobo (3-54) and Matthew Kelly (2-57) apart, the WA attack struggled with David Moody leaking 129 of 28 wicketless overs and spinner Corey Rocchiccioli taking 1-135 off 32.