Android device monitor is a tool which can be used to monitor files in your android device ( physical device or emulator ). It also provide functions to pull files from the device to your PC or push files from your PC to android device.
But when you use it, you may find the directory in right panel can not be opened. You can not list the sub folders or files under it. This article will tell you why and how to resolve such problem.
1. How To Use Android Device Monitor.
Open android studio, click Tools —> Android —> Android Device Monitor popup menu in the top tool bar, after a while you can see the monitor panel.
The left panel list the android devices ( physical or emulator ). When you select an emulator in left panel, click the File Explorer tab in right panel, you can see the directories and files in the emulator root folder.
From above picture we can see, we want to list the folders and files in the data folder, but when we click the data folder, nothing happened.
This is because the data folder’s permission is so limited for other group users. Other group users can only have execute permission. We can see that from the permissions column in right panel.
2. How To Resolve Folder Can Not Opened In Android Device Monitor.
To resolve such problems, we need to change the data folder permission first. But before do that you had better open the android device monitor first before startup the android emulator.
Follow below steps to resolve the problem.
- Open a dos command window.
- Run command
cd %ANDROID_HOME%go to android home directory.
adb shellin dos window. You can read How To Use Android Debug Bridge (ADB) to learn more.
suto change to root user.
- Now you can run
pwdto see current directory, run
cdgo to the directory you want to change permission.
chmod 777 /datato change the data directory’s permission. With this permission, all user can full control the /data folder, this may bring some risks. Take it carefully.
- After above steps, you can list the folders and files under the /data folder in android device monitor.
3. How To Resolve Pull File Permission Denied Problem.
chmod command to change file or folder permission until you can list the desired file.
Select it and click pull button in top right corner. But you may see below error message in the console output.
Failed to pull selection: open failed: Permission denied
To resolve this problem, you need to run
adb root command in dos window as below, this can let you have the permission to pull the file.
Now click the pull button again, you may encounter another error.
Failed to pull selection
To resolve this error, just click the emulator in android device monitor left panel to refresh the right File Explorer panel.
Then you can pull the file to local PC and open it to see the content.
You can also click the push button at top right corner to push file into android device that you want.