It's relatively slow to build on real iOS device compare to simulator. Running on simulator can save me a lots of time when testing the iOS plug-in I wrote. Here are the steps we need to do to make the plug-in works on simulator properly:
How?
Move void mono_dl_register_symbol (const char* name, void *addr);
out of
#if !(TARGET_IPHONE_SIMULATOR)
#endif // !(TARGET_IPHONE_SIMULATOR)
out of
#if !(TARGET_IPHONE_SIMULATOR)
#endif // !(TARGET_IPHONE_SIMULATOR)
In void RegisterMonoModules()
Move your "Extern methods" out of
#if !(TARGET_IPHONE_SIMULATOR)
#endif // !(TARGET_IPHONE_SIMULATOR) block
Move your "Extern methods" out of
#if !(TARGET_IPHONE_SIMULATOR)
#endif // !(TARGET_IPHONE_SIMULATOR) block
Result: my iAd plug-in runs on simulator.
Reference:
Building Plugins for iOS
https://docs.unity3d.com/Documentation/Manual/PluginsForIOS.html
Using the Xcode Simulator with a Unity 3 Native iOS Plug-In
http://tech.enekochan.com/2012/05/28/using-the-xcode-simulator-with-a-unity-3-native-ios-plug-in/