Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8066989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:09:18+00:00 2026-06-05T12:09:18+00:00

I need android.permission.WRITE_SETTINGS for my Android application’s junit tests. I am using IntelliJ Idea

  • 0

I need android.permission.WRITE_SETTINGS for my Android application’s junit tests. I am using IntelliJ Idea 11.1.2 and the unit tests in their own module, which contains second AndroidManifest.xml for the tests.

I added <uses-permission android:name="android.permission.WRITE_SETTINGS" /> to the test module’s AndroidManifest.xml.

Error:java.lang.SecurityException: Permission Denial: writing com.android.providers.settings.SettingsProvider uri content://settings/system from pid=1063, uid=10035 requires android.permission.WRITE_SETTINGS

Ugly quick fix: I add the same permission also to the application’s AndroidManifest.xml. Tests run without a single error.

The problem: I DO NOT want to give the whole application permission to change settings.

Is there a way to give permissions only for the tests?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:09:19+00:00Added an answer on June 5, 2026 at 12:09 pm

    Is there a way to give permissions only for the tests?

    Short answer is no.

    Your Android Test Project and Android Application Project are actually two applications, with test.apk instruments app.apk and run time. <uses-permission> is per application, added it to the test project’s AndroidManifest.xml only gives required permission to test.apk, not the application under testing i.e. app.apk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

TL;DR We need to move <uses-permission android:name=android.permission.INTERNET/> under </application> Original question Hi, I am
I need to implement Android application which will be expired after few days or
I have problem with my Android application. I need an application that will send
I have a requirement where I need to develop an Android application for Nexus
I am trying to test an Android application. I need to send mock location
In Android an application can request the android.permission.INTERNET permission. This gets translated by Android
I'm developing an android application. I need connect to sql server. I wrote a
I'm developing a simple application for Android devices. I need to create a directory,
I need to get location of user. I put in manifest <uses-permission android:name=android.permission.ACCESS_FINE_LOCATION />
Hello In my android application i am using the below code to make sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.