This paper considers the problem of the Armijo step-size gradient - descent algorithm for optimal control of switched dynamical systems as an object of study. An expression of the gradient of the cost functional is given and proved. The simulation results show that the Armijo step-size gradient - descent algorithm is good in adaptability to optimal control of switched dynamical systems.