Andrew Hogg, 23, admitted yesterday that he had also erased text messages sent by the woman shortly after he left her flat in Edinburgh's Old Town.
When police experts examined his mobile phone they found no trace of the exchanges, the High Court in Livingston was told. Giving evidence, Hogg claimed he had had consensual sex with the woman, who cannot be named for legal reasons.
Hogg, of Edinburgh, is on trial by jury before Judge Morris, charged with rape. He has pleaded not guilty to sexually assaulting the woman at her flat in the city's Canongate in November 2008.
His legal team has lodged a special defence of consent.
The trial continues.