For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • Get started
    • Overview
    • Onboarding
    • Get started
    • Launch Insights
    • LaunchDarkly architecture
    • LaunchDarkly vocabulary
  • AgentControl
    • AgentControl
    • Manage AgentControl
  • Feature flags
    • Create flags
    • Target with flags
      • Targeting rules
        • Manage targeting rules
        • Individual targeting
        • Bulk targeting
        • Mobile targeting
        • Custom rules
        • JSON targeting
      • Converting rules into segments
      • Testing changes to flag targeting
    • Flag templates
    • Manage flags
    • Code references
    • Contexts
    • Segments
  • Releases
    • Releasing features with LaunchDarkly
    • Release policies
    • Percentage rollouts
    • Progressive rollouts
    • Guarded rollouts
    • Feature monitoring
    • Release pipelines
    • Engineering insights
    • Release management tools
    • Applications and app versions
    • Change history
    • Restoring previous flag versions
  • Observability
    • Observability
    • Session replay
    • Error monitoring
    • Logs
    • Traces
    • Observability metrics
    • Product analytics events
    • LLM observability
    • Alerts
    • Dashboards
    • Service map
    • Vega for auto-remediation
    • Observability MCP server
    • Search specification
    • Observability settings
    • Observability integrations
  • Experimentation
    • Experimentation
    • Experiment metric types
    • Experiment configuration
    • Managing experiments
    • Analyzing experiments
    • Multi-armed bandits
    • Holdouts
  • Metrics and events
    • Metrics in LaunchDarkly
    • Creating metrics
    • Metric groups
    • Events
    • Autogenerated metrics
  • Warehouse native
    • Warehouse native metrics
    • Setting up external warehouses
    • Creating experiments using warehouse native metrics
  • Infrastructure
    • Connect apps and services to LaunchDarkly
    • LaunchDarkly in China and Pakistan
    • LaunchDarkly in the European Union (EU)
    • LaunchDarkly in federal environments
    • Public IP list
  • Your account
    • Projects
    • Views
    • Environments
    • Tags
    • Teams
    • Members
    • Roles
    • Account security
    • Feature previews
    • Billing and usage
    • Changelog
Sign inTry it free
LogoLogo
On this page
  • Overview
  • Target mobile apps and devices
Feature flagsTarget with flagsTargeting rules

Mobile targeting

Was this page helpful?
Previous

Custom rules

Next
Built with

Overview

This topic explains how to control which mobile apps and devices receive a variation of a feature flag.

Target mobile apps and devices

If you are using a mobile SDK that supports environment attributes, you can target your mobile applications based on automatically collected details about your application, application version, and device. You can also target mobile applications based on whether the application version is supported or unsupported. To learn more about configuring your mobile SDKs to enable this targeting, read Automatic environment attributes.

Mobile environment attributes must be collected first

You can only create a “Mobile” targeting rule, and target mobile apps and devices based on automatically collected mobile environment attributes, if you have completed the following:

  • your feature flag has its “Available on mobile SDKs” toggle set to On. To learn more, read Creating new flags. LaunchDarkly accounts created after October 21, 2025 have this box checked by default.
  • you have already started to collect mobile environment attributes in the ld_application and ld_device context kinds. LaunchDarkly must receive these context kinds before it enables the option to create a mobile targeting rule.

If you are using other mobile SDKs, you can target your mobile applications using custom targeting rules. With custom targeting rules, you can target your mobile applications based on any attributes that you have manually added to your contexts.

To target mobile apps and devices:

  1. Navigate to the Targeting tab for the flag.

  2. If the flag is off and the rules are hidden, click View targeting rules.

  3. Click the + button between existing rules, and select “Target mobile”.

    The "+" menu, with targeting options.

    The "+" menu, with targeting options.
  4. (Optional) Enter a name for the rule.

  5. In the Attribute menu, select the application or device attribute that you want to target on. By default, mobile targeting rules include clauses for the application version support status and for device information.

    • For a complete list of attributes, read About the automatically added environment attributes.
    • The os attribute includes properties for family, name, and version. To create targeting rules for these, use / as a delimiter to refer to specific fields. For example, you can create a targeting rule based on /os/family.
  6. In the Operator menu, select the operator for your clause.

  7. In the Application ID or Values menu, enter the values to check against.

  8. (Optional) Click + to add additional clauses to your targeting rule, or click - to remove existing clauses from your targeting rule.

  9. From the Select… menu, choose a rollout option:

    • a single variation to serve
    • a manual percentage rollout
    • a progressive rollout
    • a guarded rollout
    • an experiment
  10. Click Review and save. The “Save changes” dialog appears.

  11. Review your targeting changes, add comments, or request approval as needed.

  12. (Optional) Click Test run to preview the percentage of contexts that will receive each flag variation.

  13. Click Save changes.

Here is an example of a targeting rule for mobile apps:

A targeting rule for mobile apps.

A targeting rule for mobile apps.

To reference this rule when working with other members of your organization, click the three-dot overflow menu and choose Copy link to rule.