MPD
MPD copied to clipboard
Android: Now that mpd.conf is in dedicated folder, how do I get access to it?
Question
Describe the bug
0.23.9 overcame the Android restriction for file permissions, ok so mpd.conf is now located under Android/data/org.musicpd/files but how can I access this folder file manager/terminal/adb do not have access to it
While I am not an expert, wouldn't it be more practical to store the file under shared storage? (https://developer.android.com/training/data-storage/app-specific)
Shared storage is only accessible with Java APIs, i.e. all file accesses need to be rewritten to be routed through JNI instead of using good old POSIX file APIs. And all this just to circumvent Google's stupid Android API design. My time is too precious for shit like that. (Sorry for the language. These Android "improvements" have been annoying me a lot.)
no worries, just trying to ignite some ideas...i appreciate your hard work on MPD over the years
I encountered the same issue after just discovering the new expected location for mpd.conf. It seems without root permission I'm not able to create a file in that folder or move an existing file into it. I'll update if I find any possible way to create the file there.
I found a way to do this. As follows:
- Enable Android developer mode (usually by repeatedly tapping on the build number in Settings -> About Phone)
- In developer options, enable USB debugging
- On a PC (either Linux/Windows/Mac) install Android Debug Bridge (adb)
- Plug the phone into the PC via USB and allow debugging on the phone when it prompts
- Run
adb devicesand make sure the device is detected/attached - Run
adb -d shellto get a shell into your phone cdyour way to theAndroid/data/org.musicpd/filesdirectory (the full path toAndroidmight differ per phone)- Echo the desired
mpd.confcontent into a new file, e.g. for me it was:
echo 'music_directory "nfs://my-nfs-host/path/to/music" database { plugin "proxy" host "my-nfs-host" }' > mpd.conf
I was then able to run MPD as before.