Understand the saved settings affecting app behavior

Inspect approved preference values in your React Native app and make targeted changes during local debugging.

Preferences tools help explain behavior that depends on saved configuration or user state. Read the allowed stores and keys, then enable writes or removal only when you need to test or repair a specific setting.

Register the Suite

await Ansight.initializeAndActivate(
  Ansight.createOptionsBuilder()
    .withPreferencesTools({
      allowedStores: ["standard"],
      allowedKeyPrefixes: ["debug."],
    })
    .withReadWriteToolAccess()
    .build(),
);

Registration API

  • withPreferencesTools(options): configures native preferences tool options.
  • remoteTools.preferences.defaultStore: sets the default store.
  • remoteTools.preferences.allowedStores: restricts stores.
  • remoteTools.preferences.allowedKeys / allowedKeyPrefixes: restrict keys.

Specific Concerns

  • Preference values often include configuration or user state.
  • Restrict stores, keys, or key prefixes at registration time.
  • prefs.set_value uses write.
  • prefs.remove_key uses critical and requires withAllToolAccess().

Tool Matrix

NameIdPolicyDescription
List Preference Keysprefs.list_keysReadLists native preference keys.
Get Preference Valueprefs.get_valueReadReads one native preference value.
Set Preference Valueprefs.set_valueWriteWrites one native preference value.
Remove Preference Keyprefs.remove_keyCriticalDeletes one preference key.

Tool Details

Use read tools for inspection. Enable write and delete only for local workflows that need preference repair.