Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:32:43+00:00 2026-06-15T17:32:43+00:00

Is there any way to tell programatically if the app is running on the

  • 0

Is there any way to tell programatically if the app is running on the simulator with an instruments session attached to it?

If not, what would be the best way to do something special in the app (e.g. skipping user sign up) when running UI Automation tests?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:32:44+00:00Added an answer on June 15, 2026 at 5:32 pm

    In Xcode go to the Product menu and select Edit Scheme. On the left side, select the Profile row. On the right side select the Arguments tab. Turn off the “Use the Run actions…” checkbox.

    Now add an argument under “Arguments passed on launch” such as “-profile”.

    In your app, in some place you want to check for this flag, you can do something like:

    NSArray *args = [[NSProcessInfo processInfo] arguments];
    if ([args containsObject:@"-profile"]) {
        // app is being profiled
    }
    

    This check, as-is, will work on the simulator and a real device. If you only want this code for simulator and not when you profile on a real device, then wrap the code with:

    #if TARGET_IPHONE_SIMULATOR
        // simulator-only code here
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to tell GCC to not initialize a particular global array
Is there any way to tell visual studio to not include a project when
Is there any way to tell Yard not to clutter up my Rails project's
Is there any way to tell .net runtime , not to re-locate object in
Is there any way to programmatically tell android to open the keyboard when the
Is there any way to tell db4o to call class default constructor while activating
In iOS is there any way to tell, when the touch ends, if it
When adding an array at DynamoDB with put_item, is there any way to tell
Is there any easy way to tell perl now ignore everything that is printed?
Is there any simple way to tell if UNC path points to a local

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.