Community

Topic: Xamarin component

Run Xamarin.iOS app in the simulator (SOLVED)

Tomaz Saraiva
Tuesday, August 29, 2017

The SDK does not support the iOS simulator.
SDK supports armv7 and arm64 architectures. It doesn't support x86_64 platform (iOS Simulators)
I want to exclude the SDK only when building for the simulator. Is it possible to add some weak linking to the SDK or something like that?
Thanks

user profile image
Support Team  (expert)
Wednesday, August 30, 2017

Hello,
you could try this steps in order to remove pikkart SDK on x86_64 target:

  • add #if !(TARGET_OS_SIMULATOR) ... #endif in file header where you include Pikkart SDK header files
  • Instead of use "Link with Libraries" section in general tab of your xcode project, try to use OTHER_LDFLAGS in xcode project "Build Settings" and add a variant depending on your configuration (for example, on debug configuration):

  • //:configuration = Debug
    
    OTHER_LDFLAGS = -framework pikkartAR
    OTHER_LDFLAGS[sdk=iphonesimulator*] =

    Regards

Tomaz Saraiva
Thursday, August 31, 2017

Hey,
Thanks a lot for your help. I'm using Visual Studio and Xamarin.iOS, not Xcode. I have the following questions:
- I don't have header files. Can I use this directives on the .cs that is using the pikkart sdk?
- How can I configure this on Visual Studio? I cannot find those options.
Thanks once again.
Best regards.

user profile image
Support Team  (expert)
Friday, October 13, 2017

Hi,
you should try to use the compiler define symbols in your iOS project options.
In your Debug|iPhoneSimulator Compiler Configuration, you could add some custom define symbols (for example __IOS_SIMULATOR__).
Then, in your code, you could try to use conditional compilation as the following example:

#if __IOSSIMULATOR__

using Pikkart.ArSdk.Recognition;
#endif

Obviously, you should check our code in order to not use Pikkart SDK Recognition classes when you compile for simulator target
For reference, try to follow this link from xamarin forum:
https://forums.xamarin.com/discussion/20297/if-ios-seems-not-working
Kind Regards

Sign in to add a comment