我试图使用UIImagePickerController与UIImagePickerControllerSourceTypePhotoLibrary,但它说,“没有照片”。模拟器从哪里获得图像?我应该在哪里复制图像,以便它们在模拟器中显示?


当前回答

对于iOS 5.1,这将进一步更改为new path

~/库/应用程序支持/iPhone模拟器/5.1/媒体/DCIM/100APPLE

其他回答

quit the simulator.

Run simulator from the dock by clicking on it.

Drag & drop the image into simulator which you want to add.

it will open image in safari .

tap and hold the image and click the save option.

then open gallery and you will see the image which u had saved recently.

只是告诉你:KONG的解决方案也适用于iOS 7测试版。

他的解决方案是:

将图像拖到模拟器,然后打开Safari(或在互联网上使用Safari浏览图像) 按住图像上的鼠标 当弹出窗口出现时,选择保存图像并享受;)

我只是偶然发现了如何在iOS模拟器上批量上传图像。(我只在6.1上确认过。)

备份文件夹: ~/库/应用程序支持/iPhone模拟器/6.1/媒体 复制所有图片到文件夹: ~/库/应用程序支持/iPhone模拟器/6.1/媒体/DCIM/100APPLE 移动或删除文件夹: ~/库/应用程序支持/iPhone模拟器/6.1/媒体/PhotoData 重启iOS模拟器 打开照片应用程序

模拟器将恢复100APPLE文件夹中的所有图像!

只需拖放图像到iphone模拟器。浏览器将打开显示您的图像。 按下图像,直到你没有收到保存图像的选项。然后保存图像。 就是这样:)。你会看到你的图像在你的模拟器....的照片应用程序

确保设备处于运行状态。 在终端执行以下命令:

open ~/Library/Developer/CoreSimulator/Devices/$(xcrun simctl list | grep Booted | grep - eo '[a-zA-Z0-9]*-[a-zA-Z0-9]*-[a-zA-Z0-9]*-[a-zA-Z0-9]*-[a-zA-Z0-9]*')/data/Media/DCIM

进一步的regex ref @ https://regex101.com/r/tY951n/3