In order to improve the aerodynamic performance of the airfoil, the airfoil shape and the angle of attack (AOA) are optimized at the same time by the multi-island genetic algorithm in this paper. The goal of the optimization is to maximize the lift-to-drag ratio which is calculated by the computational fluid dynamics method. The airfoil is parameterized by the Bézier curve. The thickness and the camber of airfoil are no longer restricted to ensure a wide range of airfoil generation. The airfoil is optimized under different Reynolds numbers. The optimized airfoils obtained by the unconstrained AOA method are compared with several standard airfoils. The results show that the maximum lift-to-drag ratio of the optimized airfoil is much greater than the compared airfoils, and the optimized airfoils have good aerodynamic characteristics in a wide range of angle of attack. By comparing with the optimized airfoils obtained by the constrained AOA method, it shows that the constrained AOA method can't guarantee that the preconstrained angle of attack is the optimal angle of attack of the airfoil, nor can obtain the maximum lift-to-drag ratio airfoil of all angles of attack and all airfoils. However, by using the angle of attack as one of the optimization variables, these problems can be solved well.