Android device monitor is a tool that can be used to monitor files in your android device ( physical device or emulator ). It also provides functions to pull files from the device to your PC or push files from your PC to an android device.
But when you use it, you may find the directory in the right panel can not be opened. You can not list the subfolders or files under it. This article will tell you why and how to resolve such a problem.
1. How To Use Android Device Monitor.
- Open android studio, click Tools —> Android —> Android Device Monitor popup menu in the top toolbar, after a while you can see the monitor panel.
- The left panel lists the android devices ( physical or emulator ). When you select an emulator in the left panel, click the File Explorer tab in the right panel, you can see the directories and files in the emulator root folder.
- But for example, if we want to list the folders and files in the right panel 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 the execute permission. We can see that from the permissions column in the right panel.
2. How To Resolve Folder Can Not Open 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.
- You can follow the below steps to resolve the problem.
- Open a dos command window.
- Run the command
cd %ANDROID_HOME%to go to the android home directory.
adb shellin a dos window. You can read How To Use Android Debug Bridge (ADB) to learn more.
suto change to root user.
- Now you can run the command
pwdto see the current directory, run the command
cdto go to the directory you want to change permission.
chmod 777 /datato change the data directory’s permission. With this permission, all users can fully control the /data folder, this may bring some risks. Take it carefully.
C:\Users\Jerry> cd %ANDROID_hOHE% C:\Users\Jerry\AppData\Local\Android\sdk> adh shell generic_X86:/ $ su generic_X86:/ # chmod 777 /data generic_x86:/ #
- After the above steps, you can list the folders and files under the /data folder in the android device monitor.
3. How To Resolve Pull File Permission Denied Problem.
chmodcommand to change file or folder permission until you can list the desired file.
- Select the file or folder on the Android Device Monitor right panel File Explorer tab and click the pull button in the Android Device Monitor —> File Explorer tab 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 the command
adb rootin the dos window as below, this can let you have the permission to pull the file.
C: \Users\Jerry\AppData\Local\Android\sdk> adb root C: \Users\Jerry\AppData\Local\Android\sdk>
- Now click the pull button on the top right corner of the Android Device Monitor right side File Explorer tab again, you may encounter another error.
Failed to pull selection
- To resolve this error, just click the emulator in the android device monitor‘s left panel to refresh the right side File Explorer tab panel.
- Then you can pull the file to the local PC and open it to see the content.
- You can also click the push button at the top right corner of the Android Device Monitor right side File Explorer tab window to push the files on your PC into the android device that you want.
This did not work for me. I did see the permission update from drwxrwx— to drwxrwxrwx. With the command prompt and using the adb shell tool navigate to the folder I am looking for and set the permissions. I still can not navigate to the folder with the Andriod Device Monitor. clicking the arrow makes it disappear and then it reappears without opening the folder.
THANK YOU SO MUCH!!!
I noticed two additional things.
1 – I have to rename hidden folders, for example .local to local in ADB in order to see them in ADM
2 – If I push a file and it fails with an error “null” and I click the device on the left side (as you recommended for pull), the push then works