The Unity script below demonstrates how to create a Mesh (in this case a Cube) purely through code.
Simply, create a new Scene, add this script to the Main Camera, and run.
 
I’ve tested this script using the ‘PC, Mac & Linux Standalone’ Platform option, in ‘Build Settings’ (it should however, work fine on other platforms).