Answer:
#if UNITY_IOS
iPhone related codes
#endif
#if UNITY_ANDROID
Android code here
#endif
Top 10 Interview Questions and Answers in Unity 3D
Alternative:
f (Application.platform == RuntimePlatform.Android
print ("Android related functions");
else if(Application.platform == RuntimePlatform.IPhonePlayer)
print("iPhone related functions only");
Read:
Is it possible to build an app on iOS 10.3 devices with Xcode 8.2.1 without updating ?