add debug function for iPhone Simulator