Android Device Monitor File Explorer not working w

2020-02-07 19:18发布

So, just as question states. Android device monitor is not showing anything in the File Explorer view. This is only occuring on Virtual Devices running Android API Level 24+.

Any solution?

enter image description here

11条回答
smile是对你的礼貌
2楼-- · 2020-02-07 20:12

Till Android Lollypop emulators, we can access the file explorer folders. If the emulator is created with marshmallow or higher, we cant access the file explorer. May be this is bug from API level 24+.

查看更多
beautiful°
3楼-- · 2020-02-07 20:15

Another temporary solution is to use the adb shell

First, copy the database to the sdcard

./adb shell run-as com.yourapplication cp /data/data/com.yourapplication/databases/yourFileName.db /sdcard

Then, pull the database file to your computer

./adb pull /sdcard/yourFileName.db /Users/yourUserName/Desktop
查看更多
男人必须洒脱
4楼-- · 2020-02-07 20:15

As another workaround, I use fileList() to get all the files in the Files folder of my app and log it to logcat:

String[] files = fileList();
// log files, or add a watch in the debugger...

It is also possible to get the files and directories in your cache folder as well:

String[] filesInCache = getCacheDir().list();

Or

File[] filesInCache = getCacheDir().listFiles();
查看更多
成全新的幸福
5楼-- · 2020-02-07 20:20

Its an alternative way.

Create a bat file configure the APP_NAME, Example (com.example.com)

DESTINATION_FOLDER (myProjectFiles)

cd "C:\Users\USERNAME\AppData\Local\Android\sdk\platform-tools\"
adb shell run-as APP_NAME rm -R /sdcard/DESTINATION_FOLDER
adb shell run-as APP_NAME cp -R cache/ /sdcard/DESTINATION_FOLDER
rmdir C:\Users\USERNAME\Documents\DESTINATION_FOLDER /s /q
adb pull /sdcard/DESTINATION_FOLDER C:\Users\USERNAME\Documents\
timeout 5

After Configuring your bat file run it by double clicking . it will do the rest

查看更多
Summer. ? 凉城
6楼-- · 2020-02-07 20:21

I had this problem with Api 27 (Oreo). I tried to create emulator with Lollipop but same as with Oreo. Device monitor was empty.

After restarting computer everything was normal. This is solution for many problems that comes with Android Studio. First check this, than everything else.

查看更多
登录 后发表回答