title: Domain=NSCocoaErrorDomain Code=513 only when rename folder through UITests target for UI Autoamtion
body: <p>I am developing a product like DropBox and Box application, and I need to verify Rename/Add/Delete I/O operation using automation.</p>
  
  <p>I am writing UI Automation Test Cases using XCUITest in Xcode.
  In that I need to use I/O operation for rename file/folder but It gives the below error while using moveItemAtPath function to rename folder:</p>
  
  <pre><code>Error Domain=NSCocoaErrorDomain Code=513 "“Folder” couldn’t be moved because you don’t have permission to access “Folder1”." UserInfo={NSSourceFilePathErrorKey=*path, NSUserStringVariant=(
  Move), NSDestinationFilePath=*destiPath, NSFilePath=*path, NSUnderlyingError=0x6000002507d0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
  </code></pre>
  
  <p>Its working fine when running the app in main target and also its working in UnitTest target but its not working while running UITest automation target.</p>
  
  <p><strong>NOTE: App Groups are also enabled.</strong></p>
  
  <p>Any help is appreciated! </p>