Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`adb push` files are not showing on Android 11 Emulator

Tags:

android

adb

I am trying to copy photos onto my Android Emulator. I have tried

  • dragging photos onto the device screen (copying files popup does show up), but the photos do not appear anywhere. This worked on Android 8.1 and 10.
  • tried adb-pushing photos onto an Android 11 emulator. Although adb-pushed files are present on the file system (on both /sdcard/DCIM and /sdcard/Pictures), they do not show up on the device. I used adb push * /sdcard/DCIM, in a local directory with 24 photos.
  • I have also tried restarting the emulator (using the restart button on the Android UI), and no images were found. These images still exist on the filesystem. (This rules out me starting an older snapshot)

Unfortunately, the Files app shows these folders to be empty, even after restarting the emulator (Android UI restart button). My method working previously, but for some reason, can't copy photos onto the device now. Does anyone have a better method, or can confirm this method works for them?


Running Android Studio 4.1 (and tried 4.2 Canary) & Android 11.

like image 388
Ben Butterworth Avatar asked Nov 07 '22 04:11

Ben Butterworth


1 Answers

Since 2 people have upvoted, I wanted to let you know how I work around this. After pushing the files to the device, I always restart it, and wait a couple of the minutes. This allows the MediaStore (which also handles stuff I would say is non-media, e.g. documents) to find the new pictures and add it to its own database.

like image 171
Ben Butterworth Avatar answered Nov 15 '22 05:11

Ben Butterworth