How to define and use a system property in Android Instrumentation test?

前端 未结 7 1041
时光说笑
时光说笑 2020-12-02 23:25

I am trying to use some arguments for an Instrumentation test. I noticed that I can read system properties with System.getProperty() function. So I use setprop

7条回答
  •  忘掉有多难
    2020-12-03 00:03

    Because there are two types of property in Android.

    1. System level - we can get/set with command adb shell getprop/setprop.
    2. In current process level - we can get/set with regular java System.getProperty()/setProperty().

    As you are setting a system level property and trying to get its value as current process level, you are getting null value in log.

提交回复
热议问题