WLOC

Owned-app defense · Core Location

Detect simulated location on iOS without mistaking a signal for a verdict

Core Location can provide source information that indicates software simulation or an external accessory. Those fields help an owned app separate a test build from a production decision, protect sensitive actions, and explain diagnostics. They do not identify a person's intent, cover every source of inaccurate data, or prove that a location is genuine. A durable design combines source context with authorization, freshness, accuracy, server state, and a proportionate user response.

ByWLOC Product & QA TeamPractical location testing guidance
References4 cited linksPlatform, policy, and product documentation
RegionUnited StatesExamples and terminology for U.S. readers
UpdatedPlatform and policy links checked

Direct answer

Can an iOS app detect a simulated location?

An app can inspect a CLLocation's optional sourceInformation and, when present, read isSimulatedBySoftware and isProducedByAccessory. Use those values as inputs to a documented policy for an app you own. Preserve an explicit test-mode path for authorized builds, handle missing source information, validate timestamps and uncertainty, and choose a response based on the risk of the action. Do not present one Boolean as universal proof, and do not use this guide to probe or defeat another app's controls.

Before you begin

Who this guide is for

U.S. iOS engineers, fraud and trust teams, and QA owners building defensive controls in applications they operate

Implement and validate these checks only in software, accounts, and environments your organization owns or is authorized to assess. The article explains defensive interpretation, not how to conceal a test source or study a third-party detector.

Key checks

Work through the guide

Start with the section that matches your task, then follow the evidence and recovery steps before calling the test complete.

01

Read what source information actually says

CLLocationSourceInformation describes context attached to a location delivered by Core Location. Apple exposes an isSimulatedBySoftware value for a location generated using on-device software simulation and an isProducedByAccessory value for a location received from an external accessory. The enclosing CLLocation sourceInformation property is optional, so production code must define what it does when the context is absent instead of force-unwrapping it or silently inventing a result.

A true simulation flag is strong evidence that the sample came through that documented source category. A false value is not a certificate of physical presence. Normal sensor error, stale readings, account settings, manual content selections, network-derived regions, compromised application state, and server mistakes remain possible. Likewise, an accessory flag can describe legitimate equipment such as an approved external receiver. Policy must interpret the source in the context of the feature.

  • Read sourceInformation from the CLLocation used by the decision.
  • Handle true, false, and unavailable context explicitly.
  • Keep software simulation and external accessory as distinct states.
  • Never translate a false flag into guaranteed real-world presence.
02

Choose a response that matches the action's risk

For a map preview or regional demo, accepting an authorized simulated sample may be the intended behavior. For a financial, safety, attendance, regulated, or physical-access decision, the app may need to pause the action, request another approved factor, or route the case for review. Avoid a single global rule that blocks every simulated reading across the product. It will break internal QA, App Review demonstrations, customer support reproductions, and legitimate developer workflows without necessarily improving the sensitive control.

Design the user response before implementation. Explain that the app cannot complete this particular action with the current location context, preserve non-sensitive functions where possible, and offer a safe recovery path. Do not accuse the user of fraud from one signal. Log a policy reason code rather than a sensational label, and keep support tools from exposing sensitive detection detail beyond what is necessary to resolve a legitimate case.

  • Classify actions by consequence rather than applying one app-wide block.
  • Allow documented test builds and approved review accounts.
  • Use neutral, recoverable UI instead of an accusation.
  • Add another authorized factor when the decision truly requires stronger evidence.
03

Preserve a first-class path for authorized testing

A defensive check that cannot be tested will eventually fail open, be disabled, or ship with accidental production exceptions. Create an explicit entitlement, signed build configuration, test account, or owned-backend fixture that permits software-simulated input only in the authorized environment. The exception should be observable in logs and impossible to activate through an ordinary remote preference. Avoid secret coordinate lists or permanent device identifiers that are hard to rotate and easy to misuse.

Build unit fixtures for every policy combination, including missing source information, true simulation, external accessory, stale timestamp, poor accuracy, denied permission, and a qualifying normal sample. Then use Xcode's documented location simulation with an owned build to prove that the UI, analytics, backend, and recovery all agree. Test production configuration separately to confirm that debug allowances are absent from the release artifact.

  • Authorize the build, account, and backend together.
  • Keep test exceptions explicit, signed, logged, and short-lived.
  • Cover missing values and combinations instead of only true and false.
  • Verify release configuration independently from a successful debug run.
04

Combine source context with location quality and application state

The source flag answers a different question from timestamp and horizontal accuracy. A simulated sample can be fresh and precise enough for an authorized regression test. A nonsimulated sample can be old, invalid, or too uncertain for a small boundary. Evaluate those dimensions separately, then combine them in a named server or client policy. Keep the app's manual city selection, account address, IP region, and backend market outside the Core Location judgment so disagreements remain diagnosable.

For higher-risk actions, consider transaction history, device and account security, server-side velocity, or another user-approved verification step. Each additional signal has privacy and accessibility costs, so document necessity and retention. Do not collect a continuous location trail merely because the source flag exists. The goal is to make a specific decision safer, not to accumulate data or construct a hidden profile.

  • Validate freshness and uncertainty even when the source flag is false.
  • Keep device location separate from IP, account, and selected-content state.
  • Minimize collection and retain policy outcomes instead of unnecessary trails.
  • Review false positives with accessibility, privacy, support, and security owners.
05

Measure the control without publishing an evasion oracle

Track aggregate outcomes such as policy branch counts, recovery success, support contacts, and confirmed false positives. Restrict raw coordinates and detailed security logs to personnel who need them. A dashboard should distinguish unavailable source information, authorized simulation, unapproved simulation, accessory-produced data, and a general quality rejection. Collapsing all failures into one metric hides both product defects and customer harm.

Review the control when iOS behavior, supported accessories, product risk, or the testing architecture changes. Run an owned red-team exercise against the whole decision flow, but keep it scoped to your application and private environment. The result should improve failure handling and evidence, not become a public catalog of what another service detects. No location-source API eliminates the need for authorization, least privilege, appeal, and human review.

  • Measure false positives and successful recovery, not only blocks.
  • Separate policy reasons in restricted diagnostics.
  • Revalidate after platform, accessory, or risk-model changes.
  • Keep security testing inside the owned application boundary.

Decision table

Defensive source-information decision matrix

These outcomes illustrate policy structure. The owned product's risk assessment should decide whether to allow, step up, or defer each action.

Location contextWhat it establishesProportionate owned-app response
Software simulation true, authorized test buildThe sample is simulated and the signed test context permits it.Allow the test, label diagnostics, and verify cleanup.
Software simulation true, production actionThe documented source category conflicts with the action's policy.Pause only the sensitive action and offer an approved recovery.
Software simulation falseThis flag does not identify software simulation for the sample.Continue other quality and account checks; do not call it proof.
Source information unavailableThe app lacks this context for the sample.Apply the written unavailable-data policy without crashing or guessing.
External accessory trueCore Location reports an attached accessory source.Check whether the accessory is approved for this feature and user.
Fresh source, stale or uncertain sampleSource and data quality disagree.Reject or degrade on freshness or accuracy grounds, not source label.
Sensitive action after a source rejectionThe user may need a legitimate recovery or appeal.Preserve safe functions and provide a neutral next step.

Practical playbook

Implement a testable simulated-location policy

Write the decision model first so API fields, build controls, UX, and server evidence all serve the same bounded purpose.

  1. 1Inventory protected actionsIdentify the exact owned-app transactions where location source changes risk; leave unrelated browsing and support flows out of the block.
  2. 2Define a three-state source modelRepresent software simulation, accessory production, and unavailable context without turning false into a guarantee.
  3. 3Add quality and authorizationCombine source context with timestamp, accuracy, permission, signed build, test account, and backend environment.
  4. 4Exercise every policy branchUse constructed locations and Xcode simulation in an owned build, including approved tests, production denial, missing data, and recovery.
  5. 5Monitor harm and reviseMeasure false positives, appeals, support outcomes, and release-configuration integrity while minimizing retained location data.

References

Verify the claims in this guide

Open the references below for the platform documentation, service policies, and product boundaries used in the guide.

Apple API reference

CLLocationSourceInformation

The source context attached to locations and Apple's example of defensive interpretation.

Open the source ↗
Apple API reference

isSimulatedBySoftware

The Boolean for a location generated through on-device software simulation.

Open the source ↗
Apple API reference

isProducedByAccessory

The distinct Boolean for locations received from an external accessory.

Open the source ↗
Apple testing source

Simulating location in tests

Apple's authorized paths for fixed, GPX, unit, and UI-test location inputs.

Open the source ↗

FAQ

Owned-app defense · Core Location FAQ

What does isSimulatedBySoftware mean on iOS?

It indicates that Core Location generated that location using on-device software simulation. It is useful source context for an owned app, but it does not describe the user's intent or prove what every other location-related signal is doing.

Does false mean the location is genuine?

No. It means this Boolean is not reporting software simulation for that sample. The location can still be stale, uncertain, invalid, accessory-produced, inconsistent with account state, or unsuitable for the action.

What if sourceInformation is nil?

Model unavailability as its own state and follow a documented risk-based fallback. Do not crash, assume simulation, or assume physical presence solely because the context is absent.

Should an app block locations from an external accessory?

Only if the owned feature's risk assessment requires it. Apple describes legitimate accessory sources such as external GPS equipment and CarPlay, so an accessory flag should lead to an approval policy rather than a universal accusation.

How can QA test the production restriction?

Use a signed, owned test build and private backend to cover allowed simulation, then independently inspect and run the release configuration to confirm that debug exceptions cannot activate in production.

Is mock location detection enough for attendance or access control?

No single location signal should be treated as proof of identity or presence for a consequential action. Add proportionate approved factors, an accessible fallback, minimal retention, and a review or appeal path.

WLOC

Prepare a test you can verify and reverse

WLOC organizes coordinates, compatible setup, diagnostics, and recovery for iPhone testing on devices, apps, accounts, and environments you own or are authorized to test.