Search code examples
iphoneios7ios-simulatorosx-yosemitexcode7.2

added new video file is removed when simulator is relaunched


I am facing a problem.My Environment is:

OSX 10.10.5 YOsemite
xocde 7.2

I want to add a new video file(.mp4) in my ios simulator. i add this in

 /Users/mynane/Library/Developer/CoreSimulator/Devices/mydevice/data/Media/DCIM/100APPLE

after adding this, when i relaunch my simulator, than the added video is not shown. It shows only the previously added default images.

I also delete

 photoData 

but same result.

how i can solve this?


Solution

  • Please paste you video file or any file which you want to preload with ios simulator in below path

    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/
    

    or you can use below java code which will copy your desired file into the simuator location.

      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();
        }
    }