Use different material based on target platform

I’m making a game which I intend to be cross platform. I was running into performance problems on mobile and after testing a bit found if I used the legacy mobile diffuse shader it ran significantly better.

My question is, is there a way to specify different materials based on the target platform?

I would like to use my fancy normal mapped specular for Win/Mac/Linux and mobile diffuse for iOS/Android.

You can use conditional compilation to include assets only for target platform:

public class ExampleClass : MonoBehaviour {

#if UNITY_EDITOR || UNITY_ANDROID
    Material androidMaterial;
#endif

#if UNITY_EDITOR || UNITY_STANDALONE
    Material standaloneMaterial;
#endif

    Material material;

    void Start() {
#if UNITY_EDITOR || UNITY_STANDALONE
        material = standaloneMaterial;
#elif UNITY_ANDROID
        material = androidMaterial;
#endif
    }

}