Iron. That's what you need to take to increase your testosterone. No, I'm not talking about the mineral - I'm talking about something you lift off of the mat in order to build Muscle. There are actually studies that show that testosterone can be increased simply by lifting weights.
Now, before I go on, let me mention that there is a transient boost in testosterone that occurs whenever you lift weights or do strength training. The bodybuilding magazines love to make a big deal of this. But they shouldn't since this "increase" in testosterone is for the most part nothing more than a subtle increase in "hemoconcentration" of your bodies testosterone. In other words, during a workout your body is not flooding your system with testosterone as these magazines would lead to believe - quite the opposite.
So then why do I say that weight lifting leads to an increase in testosterone? Because there are several studies out there that show that patient and consistent - I emphasize the year-after-year kind - weight lifting slowly raises baseline testosterone. And I hope that grabs your attention, because it is baseline testosterone that we want to increase. Baseline testosterone can be thought of as your testosterone "smoothed out" and probably the best measure of it is early morning testosterone. Your testosterone, unless you've got a nasty sleeping disorder, peaks in the early morning hours and then tapers off until evening where it hits its low.
One fairly recent short term study of 8 young men with an average age of 17 showed significant increases in baselines testosterone (7.5%) in only 11 weeks.  This is a nice increase in testosterone when you consider that it occurred in less than three months! What did these young pups do to increase their already abundant testosterone? They simply engaged in "explosive strength training" for these 11 weeks.
Are there any studies showing that this exprapolates to longer time frames? Yes! One study of nine elite weight lifter over a two year period showed significant increases in testosterone, leutenizing hormone and the ratio of testosterone to SHBG.  The authors concluded that "the present results suggest that prolonged intensive strength training in elite athletes may influence the pituitary and possibly hypothalamic levels, leading to increased serum levels of testosterone".
Yet another study showed that elite weight lifters had significantly higher testosterone levels than elite cyclists.  In other words, the body seems to adapt to the kind of exercise placed before it. In everyday language that means that weight lifting and weigh training very likely lead to increases in testosterone over time. Remember that testosterone seems to be increased by any competitive challenge in the short term. The amazing news is that hitting the weights seems to imprint itself in our glands and force them to spit out more of the precious stuff.
As a side note, one 2008 study in the British Medical Journal had an interesting twist: it showed that those with greater strength compared to those with weakest had a 32% reduced death rate from all causes.  This is an incredible reduction, especially considering they are just looking at one factor isolated by itself. Even more remarkable is the fact that the results showed that there was a 50% reduction in heart deaths and 32% from cancer. So weight lifting should pay huge dividends in more than just increased testosterone levels.
CAUTION: Before, I got on I have to issue a caution here: you must be careful not to Overtrain or you will whack your precious testosterone instead of increasing it.
Also, one question that may have crossed your mind is if these results translate to other sports and methods of training? Well, we don't fully know the answer to that question. What we do know, though, is that long endurance sports such as cycling seem to lower testosterone in the same way that weight lifting and weight training seems to increase it. For example, one 2003 study "that basal testosterone levels were significantly lower in cyclists than age-matched weightlifters or untrained controls".  In fact, some researchers have actually concluded that this is an adaptation that gives cyclists and other endurance athletes a competitive advantage since, after all, testosoterone and it's ensuing muscle mass would probably slow them down.
So should you lay off of all endurance sports? Well, I would be cautious in making any such rule. Remember the incredible Power of Exercise. Exercise decreases heart attack risk, improves your risk of dying from all causes, lowers inflammation, improves your erectile strength, protects your brain (in a dozen ways) and, above all, gives you endurance in the bedroom. So, if your testosterone is in a halfway decent location, you will almost for sure not have to worry about a small drop in testosterone that comes with any endurance sport.
If, on the other hand, your testosterone is low anyway, then you need to be very cautious about lowering it any further with a triathlon or marathon. Remember: the Symptoms of long term low testostone are nothing but ugly and dangerous. Rememember you want to increase your testosterone if need be in order to increase your mental outlook and attitude as well as build your lean body and muscle mass. Testosterone does all that for you: there is no substitute!
NOTE: Taking Cialis (or probably any of the erection-boosting PDE5 inhibitors) increases testosterone post-exercise in healthy male subjects.  So should you pop this pill before going to the gym? Well, not so fast: the study also showed that Cialis amplified cortisol significantly more than normal as well. The last thing most of us guys need is more cortisol, which leads to muscle tissue breakdown, visceral fat deposition and other ills. In addition, you should read the following links that cover The Dangers of Recreational Use of Viagra and Side Effects of Viagra, Cialis
1) Eur J of Applied Physio, 2004, 91(5-6):698-707
2) J Appl Physiol, 1988, 65:2406-2412
3) J of Strength and Conditioning Res,Feb 2003, 17(1):129-39
4) Brit Med J, 2008, 337:a439
5) J of Sports Sciences, 2004, 22(5):465-478
6) The Journal of Clinical Endocrinology & Metabolism, 2008, 93(9):3510-3514, "The Type 5 Phosphodiesterase Inhibitor Tadalafil Influences Salivary Cortisol, Testosterone, and Dehydroepiandrosterone Sulphate Responses to Maximal Exercise in Healthy Men"