A novel and versatile gas bubble induced self-assembly technique is developed for the one-step fabrication of vertically aligned polycrystalline Co3O4 nanotube arrays (NTAs) by the rapid thermal decomposition of Co(NO3)2·6H2O on a flat substrate. In this protocol, the in situ generation and release of gas bubbles, which can be regulated by elaborately adjusting the kinetic factors such as reaction time, decomposition temperature and pressure as well as the content of the chemically adsorbed water, play a vital role in the formation of the Co3O4 NTAs. Due to the shape anisotropy, ordered hierarchically porous structure and high surface area, the as-obtained Co3O4 NTAs show unique magnetic properties of a low Néel temperature and a large exchange bias field, as well as an initial discharge capacity up to 1293 mAh·g−1 at 35 mA·g−1 and the retention of a charge capacity as high as 895.4 mAh·g−1 after 10 cycles. This endows them with important potential use in magnetic shielding, magnetic recording media, and lithium ion batteries, etc. Due to the simplicity of the self-assembly method, this process is applicable to the large-scale production of the Co3O4 NTAs, and may be extended to other materials.