<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "StoreKitTest"
  },
  "title" : "StoreKit Test"
}
-->

# StoreKit Test

Create and automate tests in Xcode for your app’s subscription and in-app purchase transactions, and SKAdNetwork implementations.

## Overview

The StoreKitTest framework makes StoreKit testing in Xcode available for automation. Use this framework to write unit tests and continuous integration tests. Use [`SKTestSession`](/documentation/StoreKitTest/SKTestSession) and [`SKAdTestSession`](/documentation/StoreKitTest/SKAdTestSession) to control the test environment.

For testing in-app purchase transactions, use `SKTestSession`. Each instance of `SKTestSession` gives you access to the same settings you manually change for StoreKit testing in Xcode. Use this class to test a variety of in-app purchase scenarios, such as subscription renewals and Ask to Buy transactions, and maintain control over the transactions in the testing environment.

For testing ad impressions and postbacks, use `SKAdTestSession`. Each instance of `SKAdTestSession` holds a set of test postbacks that you create and can use in multiple unit tests. Ad networks that use <doc://com.apple.documentation/documentation/StoreKit/SKAdNetwork> APIs can use this class to validate the ad impressions that they sign, and test receiving postbacks on their server. Advertised apps can test their conversion value updates.

Testing StoreKit in iOS, watchOS, or tvOS apps requires Xcode 12 or later running on macOS 10.15 or later. Testing StoreKit in a macOS app requires Xcode 12 or later running on macOS 11 or later.

> Related session from WWDC20:
> Session 10659 : [Introducing StoreKit testing in Xcode](https://developer.apple.com/wwdc20/10659)

## Topics

### StoreKit transaction testing

  <doc://com.apple.documentation/documentation/Xcode/setting-up-storekit-testing-in-xcode>

[`SKTestSession`](/documentation/StoreKitTest/SKTestSession)

The controls and environment configuration you use to test StoreKit transactions in Xcode.

[`SKTestTransaction`](/documentation/StoreKitTest/SKTestTransaction)

A transaction that occurs in the testing environment.

### StoreKit transaction testing errors

[`SKTestErrorDomain`](/documentation/StoreKitTest/SKTestErrorDomain)

A constant that represents the domain for error codes in the testing environment.

[`SKTestError`](/documentation/StoreKitTest/SKTestError)

Information about an error that the testing environment returns.

### StoreKit transaction testing errors

[`SKTestErrorDomain`](/documentation/StoreKitTest/SKTestErrorDomain)

A constant that represents the domain for error codes in the testing environment.

[`SKTestError.Code`](/documentation/StoreKitTest/SKTestError/Code)

Error codes in the testing environment.

### Ad impression and postback testing

[Testing and validating ad impression signatures and postbacks for SKAdNetwork](/documentation/StoreKitTest/testing-and-validating-ad-impression-signatures-and-postbacks-for-skadnetwork)

Validate your ad impressions and test your postbacks by creating unit tests using the StoreKit Test framework.

[`SKAdTestSession`](/documentation/StoreKitTest/SKAdTestSession)

The class you use to test ad impressions and postbacks in Xcode.

[`SKAdTestPostback`](/documentation/StoreKitTest/SKAdTestPostback)

A test postback that contains ad conversion information in the testing environment.

[`SKAdTestPostbackResponse`](/documentation/StoreKitTest/SKAdTestPostbackResponse)

The status and error information for a postback that the system sends in the testing environment.

[`SKAdTestPostbackVersion`](/documentation/StoreKitTest/SKAdTestPostbackVersion)

A constant that indicates the postback version.

### Ad impression and postback errors

[`SKAdTestErrorDomain`](/documentation/StoreKitTest/SKAdTestErrorDomain)

A string that identifies the error domain for SKAdNetwork testing in the testing environment.

[`SKAdTestError`](/documentation/StoreKitTest/SKAdTestError)

An error the testing environment returns for SKAdNetwork testing errors.

### Ad impression and postback errors

[`SKAdTestErrorDomain`](/documentation/StoreKitTest/SKAdTestErrorDomain)

A string that identifies the error domain for SKAdNetwork testing in the testing environment.

[`SKAdTestError.Code`](/documentation/StoreKitTest/SKAdTestError/Code)

Enumerated error codes related to ad network testing in the testing environment.

### Structures

[`StoreKitAppStoreSyncAPI`](/documentation/StoreKitTest/StoreKitAppStoreSyncAPI)

[`StoreKitAppTransactionAPI`](/documentation/StoreKitTest/StoreKitAppTransactionAPI)

[`StoreKitLoadProductsAPI`](/documentation/StoreKitTest/StoreKitLoadProductsAPI)

[`StoreKitManageSubscriptionsAPI`](/documentation/StoreKitTest/StoreKitManageSubscriptionsAPI)

[`StoreKitOfferCodeRedeemAPI`](/documentation/StoreKitTest/StoreKitOfferCodeRedeemAPI)

[`StoreKitPurchaseAPI`](/documentation/StoreKitTest/StoreKitPurchaseAPI)

[`StoreKitRefundRequestAPI`](/documentation/StoreKitTest/StoreKitRefundRequestAPI)

[`StoreKitSubscriptionStatusAPI`](/documentation/StoreKitTest/StoreKitSubscriptionStatusAPI)

[`StoreKitVerificationAPI`](/documentation/StoreKitTest/StoreKitVerificationAPI)

### Enumerations

[`SKTestFailures`](/documentation/StoreKitTest/SKTestFailures)

### Protocols

[`FailableStoreKitAPI`](/documentation/StoreKitTest/FailableStoreKitAPI)

[`SKTestFailure`](/documentation/StoreKitTest/SKTestFailure)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)