简体   繁体   中英

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

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.

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, eg documents) to find the new pictures and add it to its own database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM