This paper describes a new locomotion mode to use in a crawling robot, inspired of real inchworm. The crawling device is modelled as a mobile manipulator, and for each step of its motion, the associated dynamics relations are derived using Euler-Lagrange equations. Next, the Genetic Algorithm (GA) is utilized to optimize the trajectory of the free joints (active actuators) in order to minimize the consumed effort (e.g. integral of square of torques over the step time). In this way, the results show a reduction of 5 to 37 percent in torque consumption in comparison with the gradient based method. Finally, numerical simulation for each step motion is presented to validate the proposed algorithm.