Tôi đang chạy một máy ảo trong Android Studio. Vấn đề là nó không bao giờ gắn thẻ SD. Trong cài đặt, tôi đã cố gắng studio-quản lý (100MB) cũng như tạo ra một bằng bản thân mình:Trình giả lập Android sẽ không gắn thẻ SD
$ ./mksdcard -l sdCard 100M sdcard.img
Các tập tin nằm trong thư mục nhà của tôi với quyền W R /.
Đây là cấu hình của tôi:
avd.ini.encoding=UTF-8
AvdId=DEVICEC_API_17
PlayStore.enabled=false
abi.type=x86
avd.ini.displayname=DEVICEC API 17
disk.dataPartition.size=800M
hw.accelerometer=no
hw.audioInput=yes
hw.battery=yes
hw.camera.back=emulated
hw.camera.front=emulated
hw.cpu.arch=x86
hw.cpu.ncore=4
hw.dPad=no
hw.device.manufacturer=User
hw.device.name=DEVICEC
hw.gps=no
hw.gpu.enabled=yes
hw.gpu.mode=auto
hw.initialOrientation=landscape
hw.keyboard=yes
hw.lcd.density=160
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=no
hw.sensors.proximity=no
hw.trackBall=no
image.sysdir.1=system-images/android-17/google_apis/x86/
runtime.network.latency=none
runtime.network.speed=full
sdcard.path=/home/user/sdcard.img
showDeviceFrame=no
skin.dynamic=yes
skin.name=800x600
skin.path=_no_skin
skin.path.backup=_no_skin
tag.display=Google APIs
tag.id=google_apis
vm.heapSize=48
Như bạn thấy, hw.sdCard
được thiết lập để YES
.
Thành thật mà nói tôi không biết phải tìm gì trong Logcat. Lọc MOUNT Tôi thấy điều này:
08-14 17:45:55.544 1495-1508/system_process I/SystemServer: Mount Service
08-14 17:45:55.544 1495-1508/system_process D/MountService: got storage path: /mnt/sdcard description: USB storage primary: true removable: false emulated: false mtpReserve: 0 allowMassStorage: false maxFileSize: 0
08-14 17:45:55.544 1495-1508/system_process D/MountService: addVolumeLocked() StorageVolume [mStorageId=0 mPath=/mnt/sdcard mDescriptionId=17040615 mPrimary=true mRemovable=false mEmulated=false mMtpReserveSpace=0 mAllowMassStorage=false mMaxFileSize=0 mOwner=null]
08-14 17:45:55.554 1495-1533/system_process D/MountService: volume state changed for /mnt/sdcard (null -> removed)
08-14 17:45:55.554 1495-1533/system_process W/MountService: getSecureContainerList() called when storage not mounted
Tôi cũng đã cố gắng chạy này trong dòng lệnh:
$ ./emulator -avd CASIO_API_17 -sdcard /home/mariano/sdcard.img
Nhưng tôi không thấy bất kỳ lỗi. Thẻ SD sẽ không gắn kết.
bạn nên thêm trước hết là viết bên ngoài permision –
thay đổi hình ảnh khối lượng nhãn từ sdcard cái gì khác. –
> trước hết bạn nên thêm chữ viết bên ngoài Để làm gì? > thay đổi nhãn âm lượng hình ảnh từ sdCard một thứ khác. khối lượng hình ảnh nào? –