0

I'm trying to add system properties that will be available for 'adb' access.

Following this thread: How to add new System Properties in java

I tried doing the following:

System.setProperty("TEST", "test");
String prop = (System.getProperty("TEST"));
Toast.makeText(LoginActivity.this, prop, Toast.LENGTH_LONG).show();

The last line displays a good result (I see a Toast with "test") so I know that the property was set properly.

When I try to access the same property for adb, I get a null value:

adb shell

getprop TEST

(response is empty) Any help would be really appreciated. Thanks, Amir

Community
  • 1
  • 1
  • Can you show code for access the same property for adb? – T D Nguyen Nov 17 '15 at 10:17
  • What do you get when you try adb shell getprop (this should view all the properties) ? without supplying it a param. Can you also try to adb shell stop and adb shell start and then do adb shell getprop param. – Raf Nov 17 '15 at 10:22
  • Thanks for your comments, In general, this is the code I'm trying to do: adb shell getprop TEST Example: C:\Users\Amir>adb shell getprop TEST C:\Users\Amir> As you can see, the result is empty. I'm also trying: C:\Users\Amir>adb shell setprop my.test 1234 C:\Users\Amir>adb shell getprop my.test C:\Users\Amir> This also fails. – user2406584 Nov 18 '15 at 09:41

0 Answers0