Stay organized with collections
Save and categorize content based on your preferences.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-15 UTC."],[],[],null,["# androidx.test.rule\n==================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/androidx/test/rule/package-summary \"View this page in Kotlin\") \\|Java\n\nClasses\n-------\n\n|------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ActivityTestRule](/reference/androidx/test/rule/ActivityTestRule) | **This class is deprecated.** use [androidx.test.core.app.ActivityScenario](/reference/androidx/test/core/app/ActivityScenario) or instead. \u003cbr /\u003e |\n| [DisableOnAndroidDebug](/reference/androidx/test/rule/DisableOnAndroidDebug) | The `DisableOnAndroidDebug` Rule allows you to label certain rules to be disabled when debugging. |\n| [GrantPermissionRule](/reference/androidx/test/rule/GrantPermissionRule) | The `GrantPermissionRule` Rule allows granting of runtime permissions on Android M (API 23) and above. |\n| [ServiceTestRule](/reference/androidx/test/rule/ServiceTestRule) | A JUnit rule that provides a simplified mechanism to start and shutdown your service before and after the duration of your test. |\n| [UiThreadTestRule](/reference/androidx/test/rule/UiThreadTestRule) | **This class is deprecated.** use [UiThreadTest](/reference/androidx/test/annotation/UiThreadTest) directly without this rule. \u003cbr /\u003e |"]]