locked
Is there a programmatic way to detect whether the app is running within the Simulator? RRS feed

Answers

  • Hi Ben,

    afaik there's no special property for that. But the simulator is created via a Remote Desktop-call to your host system. So maybe a check like this will solve your problems during development:

          if(Windows.System.RemoteDesktop.InteractiveSession.IsRemote)
                {
                    // is running in simulator
                }
                else
                {
    
                }


    Thomas Claudius Huber

    "If you can´t make your app run faster, make it at least look & feel extremly fast"

    twitter: @thomasclaudiush
    homepage: www.thomasclaudiushuber.com
    author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook

    Saturday, September 14, 2013 9:22 PM
  • Hi Ben,

    There is no official API for you can determine if the app is running within a simulator.

    What Thomas provided is a kind of solution. But this event will also fires when the process is running in a Remote Desktop session.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 16, 2013 7:43 AM
    Moderator

All replies

  • Hi Ben,

    afaik there's no special property for that. But the simulator is created via a Remote Desktop-call to your host system. So maybe a check like this will solve your problems during development:

          if(Windows.System.RemoteDesktop.InteractiveSession.IsRemote)
                {
                    // is running in simulator
                }
                else
                {
    
                }


    Thomas Claudius Huber

    "If you can´t make your app run faster, make it at least look & feel extremly fast"

    twitter: @thomasclaudiush
    homepage: www.thomasclaudiushuber.com
    author of: ultimate Windows Store Apps handbook | ultimate WPF handbook | ultimate Silverlight handbook

    Saturday, September 14, 2013 9:22 PM
  • Hi Ben,

    There is no official API for you can determine if the app is running within a simulator.

    What Thomas provided is a kind of solution. But this event will also fires when the process is running in a Remote Desktop session.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 16, 2013 7:43 AM
    Moderator
  • Thomas and James. This is more appropriate check. Thanks.

    Monday, September 16, 2013 6:12 PM