添加的新视频文件在模拟器重新启动时被删除

added new video file is removed when simulator is relaunched

我面临的是problem.My环境是:

OSX 10.10.5 YOsemite
xocde 7.2

我想在我的 ios 模拟器中添加一个新的视频文件 (.mp4)。我在

中添加了这个
 /Users/mynane/Library/Developer/CoreSimulator/Devices/mydevice/data/Media/DCIM/100APPLE

添加这个之后,当我重新启动我的模拟器时,添加的视频没有显示。它只显示以前添加的默认图像。

我也删

 photoData 

但结果相同。

我该如何解决这个问题?

请将您的视频文件或您想要使用 ios 模拟器预加载的任何文件粘贴到下面的路径

String str = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS 9.2.simruntime/Contents/Resources/SampleContent/Media/DCIM/100APPLE/

或者您可以使用下面的 java 代码将您想要的文件复制到模拟器位置。

  public  void preloadFiletoSimulator(String filename){
    try {
        File dest = new File(str);
        String name = AppConstant.RESOURCE_DIR+filename;
        File source = new File(name);
        FileUtils.copyFileToDirectory(source, dest);
    } catch (IOException e) {
        e.printStackTrace();
    }
}