The often complex cocktails of hydrocarbon compounds found on the cuticles of insects can serve both naturally and sexually selected functions, contributing to an individual's ability to withstand water loss and attract mating partners. However, whether natural and sexual selection act synergistically or antagonistically on a species' cuticular hydrocarbon (CHC) profile remains unclear. Here, we examined the ontogeny of the CHC profile in a species of cricket, Teleogryllus oceanicus, while manipulating humidity during development. We predicted that juvenile crickets should produce only those compounds that contribute to desiccation resistance, while those compounds contributing specifically to male attractiveness should be produced only at sexual maturity. Further, if attractive CHCs come at a cost to desiccation resistance as predicted by some models of sexual selection, then males reared under low humidity should be constrained to invest less in attractive CHCs. Crickets reared under low humidity produced more long-chain methyl-branched alkanes, alkenes and alkadienes than did crickets reared under high humidity. The abundance of n-alkanes was unaffected by humidity treatment. Sexual dimorphism in the CHC profile was not apparent until adult emergence and became exaggerated 10 days after emergence, when crickets were sexually mature. Males produced more of the same compounds that were increased in both sexes under low humidity, but the humidity treatment did not interact with sex in determining CHC abundance. The data suggest that CHC profiles which protect crickets from desiccation might have synergistic effects on male attractiveness, as there was no evidence to suggest males trade-off a CHC profile produced in response to low humidity for one associated with sexual signalling.