I have an App that needs to detect, if a USB Storage device is getting mounted. Can i simulate the mounting of an USB Storage Device while the Emulator is already running? This way i can debug the behavior of my app.
As i know, for registering the mounting and unmounting of the USB Storage Device i can use the StorageVolumeCallback()
. What do i have to do to write a simple .txt File to that attached USB Storage Device?
Im having trubble to create a StorageManager inside my ViewModel because i do not have access to the Context
.
Im thankful for any Tipp related to USB Storage Management at all.
Info: API Version: 31 IDE: Android Studio Language: Kotlin
Edit:
So i do not necessarily need to have a external usb drive mounted at startup. If its possible with adb it would be great if i could just forward a usb Pendrive to the running emulator when i need it. Something like adb connectUsbDevice -deviceid=****,vendorid=***