The SCARA robot is a robotic arm with a simple structure, high speed, and high precision. It is widely used in the industry. This paper aims to study the optimal motion planning of a SCARA robot. The Euler-Lagrange method is used to derive the dynamic model of the system. The chosen paths are based on the straight line and the cubic spline interpolation method. The minimum-time path is planned using the phase-plane method, which can meet the torque constraints, and the phase-plane method is realized in MATLAB to obtain path commands. In a Linux-based environment, Gazebo is used to construct and simulate the dynamic model of the SCARA robot. The angular commands of every joint of a planned path are given to the plugin of Gazebo to obtain the dynamic responses. Finally, this motion planning method is tested on an EPSON's SCARA robot for the performance validation.