The design and implementation of particle swarm optimization (PSO) gait learning method for adult-sized humanoid robots is proposed in this paper. In order to reduce the motor damage and let train motions more convenient, a robotics simulator system for humanoid robots is designed. This robotics simulator system is established by an open source software-Open Dynamics Engine (ODE). The model of David developed by aiRobots laboratory is a combination of rigid bodies and joints. The humanoid robot is trained on the robotics simulator system with PSO method, which chooses the trajectory of robot's center of mass as the fitness value to learn faster and stable gait automatically. The results of the experiment show that the motions which play on the robotics simulator system are very similar to the real motions, so it can be utilized as the motion training platform. The result of the PSO gait learning method has great performance on the robotics simulator system. The humanoid robot learns gait pattern from marking time to moving center of mass and swing its legs. Finally, this gait let the real humanoid robot walk forward at 14.5 cm/s.