We demonstrate measurement and control of single-asperity friction by using cantilever probes featuring an in situ solid-state heater. Heating caused friction to increase by a factor of 4 in air at ∼30% relative humidity, but in dry nitrogen friction decreased by ∼40%. Higher velocity reduced friction in ambient with no effect in dry nitrogen. These trends are attributed to thermally assisted formation of capillary bridges between the tip and substrate in air, and thermally assisted sliding in dry nitrogen. Real-time friction measurements while modulating the tip temperature revealed an energy barrier for capillary condensation but with slower kinetics compared to isothermal measurements that we attribute to the distinct thermal environment that occurs when heating in real time. Controlling the presence of this nanoscale capillary and the associated control of friction and adhesion offers new opportunities for tip-based nanomanufacturing.