Indicates that a specific test should not be run on emulator.
The test will be skipped if its executed on one of the recognized Android emulator types (currently ones with Build.HARDWARE equal to 'goldfish', 'ranchu' and 'gce_x86')
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-07-17 UTC.
[null,null,["Last updated 2025-07-17 UTC."],[],[],null,["# RequiresDevice\n==============\n\nArtifact: [androidx.test:runner](/jetpack/androidx/releases/test) \n[View Source](https://cs.android.com/search?q=file:androidx/test/filters/RequiresDevice.java+class:androidx.test.filters.RequiresDevice)\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/test/filters/RequiresDevice \"View this page in Java\")\n\n\n```\n@Retention(value = RetentionPolicy.RUNTIME)\n@Target(value = [ElementType.TYPE, ElementType.METHOD])\nannotation RequiresDevice\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n| **This annotation is deprecated.** \n|\n| This annotation should provide limited benefit. Use a more specific filtering mechanism to tie tests to a specific environment if needed.\n\nIndicates that a specific test should not be run on emulator.\n\nThe test will be skipped if its executed on one of the recognized Android emulator types (currently ones with Build.HARDWARE equal to 'goldfish', 'ranchu' and 'gce_x86')"]]