Requirements: I need to use adb
to store a string value somewhere on an Android device that later is to be consumed by the app I'm programming upon first launch. The app is not installed when the String value is to be stored. The following requirements apply:
- It must not require any runtime permissions that require user interaction to grant (adb grant is OK)
- It must work on Android 12 and above
- The String value must be able to change independently of the APK so it cannot be bundled
- It cannot be passed though Instrumentation args (although this is for Android tests)
Methods attempted:
- Store a file on a predefined location, like
/sdcard/Downloads
. Does not work because of tightened permission model from Android 11 and above - Store a file in the app local folder, like
/sdcard/Android/data/com.my.app/files/
. Does not work because the folder is cleared on install on some (not all) devices
edit: I need this for a specific CI/CD config scenario. This is not something I will ship into the wild.