Possible for Android JUnit test to create a config file in the target apps data directory?

StackOverflow https://stackoverflow.com//questions/9566622

  •  06-12-2019
  •  | 
  •  

Question

I would like my Robotium test to create a configuration file for the application I am testing to read. The file would be located in the internal storage /data directory associated with the tested application.

Is this possible? At the moment I am getting a "Permission denied" error.

Was it helpful?

Solution 2

It is actually possible to create files in data storage outside of an applications designated area. However, if these files are already generated by the target application, they must have WRITABLE permissions to enable the test application to modify them.

In my case my application does not generate the files, so this is not a problem.

OTHER TIPS

Write shell script and push your file with adb root command. If that doest not help you -create file inside your test.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top