Well, that clearly depends on what you need. Libgdx and Cocos2d have very different APIs. Therefore, I really recommend that you simply check both of them and choose what is best for you in the end. Personally, I don't like the Cocos2d API. Libgdx is much lower level and allows you to completely separate the rendering logic from your game logic.
Libgdx is written in Java on top of C ++. However, critical parts of the performance are written to native code to execute at optimal speed. I personally looked at a lot of frameworks and did not find anything that would be better than libgdx. Development also becomes very fast when exchanging hot code, which allows you to run and modify the code in your game without recompiling. Libdgx also allows you to deploy HTML5 without rewriting anything. iOS is WIP. Therefore, if iOS is your first priority, you need to wait for libgdx to support this.
The biggest benefit of using libgdx is the extremely useful community that manages it. You will receive answers very quickly, as well as the help of the developers themselves.
Needless to say, I am an avid proponent of libgdx.
source share