replace in where it use deprecated API
save the spec result only into file on OSX platform

The build log and spec result were saved in file.