Although metal-organic frameworks (MOFs) have shown great potential in superlubricity due to the inorganic-organic hybridization, there is little understanding of their interlayer sliding ability. Simple and convenient testing techniques are also lacking. In this paper, an ingenious method for measuring interlayer friction of layered MOFs and its heterojunctions was developed, namely coating the friction pairs with highly oriented crystalline films assembled by MOFs nanosheets. The overall incommensurability contributed to the robust interlayer superlubricity (mu similar to 0.0013) that is insensitive to the sliding angle. The interlayer sliding behavior of 2D MOFs differs from that of conventional materials in that the interlayer sliding resistance of heterojunction with lattice mismatch is not necessarily lower than that of homojunction. Theoretical simulation enables us to explore the mechanism of interlaminar sliding resistance of MOFs, which is the energy barrier generated by vertical alignment of the congeneric components between layers. And the key structural factors that determine the strength of frictional resistance and frictional anisotropy between MOFs layers, namely coordination stability and lattice constant, were discovered. Therefore, the structure-function relationship was established to guide the structural design.