title: iOS App Receipt Validation - Receipt is missing in simulator and on device while debugging
body: <p>Why would my app lack an Receipt while in development?</p>
  
  <p>I am running my iOS (7, 8, 9) app from Xcode 7.3.1. The app’s Receipt seems to be missing. This app is currently shipping in the App Store, so I have my developer credentials, and a “sandbox” user login.</p>
  
  <h1>Simulator</h1>
  
  <p>When running the following code:</p>
  
  <pre><code>NSURL* url = [[NSBundle mainBundle] appStoreReceiptURL];
  NSLog(@"url: %@", url);
  </code></pre>
  
  <p>The result in the Simulator 9.3 for iPhone 6s Plus:</p>
  
  <blockquote>
    <p>file:///Users/Bourque/Library/Developer/CoreSimulator/Devices/7F32850A-CC1A-45A3-8ED6-95C75CD9DD44/data/Containers/Data/Application/46BDF021-D2A3-418E-91E1-61A15215942B/StoreKit/receipt</p>
  </blockquote>
  
  <p>Yet when I navigate to the folder named with the 2nd UUID, I find no <code>StoreKit</code> folder. </p>
  
  <h1>Real device</h1>
  
  <p>To test on a real iOS iPod touch, I expand that code to…</p>
  
  <p>…See where the Receipt should be found.</p>
  
  <pre><code>NSURL* url = [[NSBundle mainBundle] appStoreReceiptURL];
  NSLog(@"url: %@", url);
  </code></pre>
  
  <p>…Try to load such a file.</p>
  
  <pre><code>NSString* urlContents = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
  NSLog(@"urlContents: %@", urlContents);
  </code></pre>
  
  <p>…Verify if the file exists.</p>
  
  <pre><code>NSError *err;
  if ( [url checkResourceIsReachableAndReturnError:&amp;err] == NO ) {
      NSLog(@"BAD No receipt found for url: %@" , url );
  } else {
      NSLog(@"GOOD Receipt found for url: %@" , url );
  }
  </code></pre>
  
  <p>Results when run.</p>
  
  <blockquote>
    <p>url: file:///private/var/mobile/Containers/Data/Application/21430192-6E3A-4929-B847-23FD525D804E/StoreKit/sandboxReceipt</p>
    
    <p>urlContents: (null)</p>
    
    <p>BAD No receipt found for url: file:///private/var/mobile/Containers/Data/Application/21430192-6E3A-4929-B847-23FD525D804E/StoreKit/sandboxReceipt</p>
    
    <p>file:///private/var/mobile/Containers/Data/Application/B1497F0D-95A7-4AD8-A9D5-7AF95663A04F/StoreKit/sandboxReceipt</p>
  </blockquote>