You gain muscles only by training with heavy weights
and pushing yourself to the limit. Doing CrossFit is still one of the best ways to do so. It integrates exercises like deadlifts, squats, olympic lifts, push ups, pull-ups, burpees etc. in your training routine. These exercises target the whole body and will help you build muscle mass. And if you still want to do cardio, try HIIT (High Intensity Interval Training).
Weight trainers who are working to develop power and tone know that you have to push the muscle to the point of fatigue so that the muscle needs to rebuild and strengthen itself. That’s why common weight training techniques involve pushing to the point of exhaustion, then quickly fueling the muscles so they can rebuild with the proper nutrients. With each forward step in a workout program over the course of months (and years), weight lifters gradually increase the weight, frequency and intensity of their workouts to continue to stack lean muscle.
CrossFit is designed to build muscle mass in a manner that is both explosive and balanced over the entire body.