title: Creating receipt during IOS7 validation
body: <p>I have begun testing in-app purchases on IOS7 and am working on receipt validation, but I'm confused about when receipts are actually produced during testing (launching the app from Xcode). According to the 2013 WWDC video #508, a receipt is generated as you download the app from the store. Thus, it wasn't surprising when I first launched my app from Xcode and did NOT find a receipt, since the store wasn't involved in the transaction. But, I found this tidbit in Apple's <a href="https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Introduction.html" rel="nofollow">Receipt Validation Programming Guide</a>:</p>
  
  <pre><code>Test During the Development Process
  
  In order to test your main application during the development process, you need a 
  valid receipt so that your application launches. To set this up, do the following:
  
  Make sure you have Internet access so you can connect to Apple’s servers.
  Launch your application by double-clicking on it (or in some way cause Launch Services 
  to launch it). After you launch your application, the following occurs:
  
  Your application fails to validate its receipt because there is no receipt present, and 
  it exits with a status of 173.
  The system interprets the exit status and attempts to obtain a valid receipt. Assuming 
  your application signing certificate is valid, the system installs a valid receipt for the
  application. The system may prompt you for your iTunes credentials.
  The system relaunches your application, and your application successfully validates the
  receipt.
  With this development receipt installed, you can launch your application by any 
  method—for  example, with gdb or the Xcode debugger.
  </code></pre>
  
  <p>So I tried the following code:</p>
  
  <pre><code>NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
  NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
  if (!receipt)
  {
      NSLog(@"    No receipt found!");
      exit(173);
  </code></pre>
  
  <p>Which does indeed report, "No receipt found" and exits. I re-launched the app from the device. It promptly exited. I restarted from Xcode, it again exited... no receipt.</p>
  
  <p>At this point, I'm confused. I'm probably missing something obvious here, but: how does one produce the initial receipt while testing during development?</p>
  
  <p>Thanks,</p>