Game Testing
Updated: Jun 28, 2026
Copy for LLM
Testing is a critical part of developing an Instant Game. Because your game runs across multiple platforms (iOS, Android, and the desktop web), inside a Facebook-managed runtime, and with real social and monetization features, thorough testing requires a deliberate approach that goes beyond simply opening your game in a browser.
This guide covers everything you need to know about testing your Instant Game, from local development all the way through to validating production-ready builds.
Development builds vs. production builds
Before diving into testing methods, it is important to understand the two types of builds you will work with:
Development builds
A development build is a version of your game that you are actively working on. During development:
- You can test your game locally using a local HTTPS server.
- You can upload test builds to the App Dashboard without affecting your live game.
- You can use debug and logging tools to inspect behavior.
- Your game is only accessible to the app’s administrators, developers, and testers.
Production builds
A production build is the version of your game that is live and accessible to all players. When you push a build to production:
- The production build replaces the previously live version for all players.
- The production build goes through any applicable review processes.
- Debug logging should be minimized or removed.
- All assets should be optimized for performance.
Always test thoroughly in a development build before pushing to production.
Testing locally
During active development, you will want to test your game on your local machine before uploading it to the App Dashboard. The Instant Games SDK requires an HTTPS connection, so you cannot simply open your
index.html file in a browser.Setting up a local HTTPS server
- Generate a self-signed SSL certificate. You can use OpenSSL:
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodesWhen prompted, you can enter any values for the certificate fields. The certificate does not need to be valid for local testing. - Start a local HTTPS server. You can use any tool that supports HTTPS. Here are some options:Using Node.js (with the
http-serverpackage):npx http-server -S -C cert.pem -K key.pem -p 8080Using Python:import http.server import ssl server_address = ('', 8080) httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler) httpd.socket = ssl.wrap_socket(httpd.socket, certfile='cert.pem', keyfile='key.pem', server_side=True) httpd.serve_forever() - Open the game in your browser. Navigate to
https://localhost:8080. Your browser will warn you about the self-signed certificate. Accept the warning and proceed.
Limitations of local testing
When testing locally, the Instant Games SDK (
FBInstant) is not available because your game is not running within the Facebook runtime. To work around this:- Create a mock SDK. Write a simple mock object that implements the
FBInstantAPIs your game uses. This allows your game code to run without modification. For example:if (typeof FBInstant === 'undefined') { window.FBInstant = { initializeAsync: function() { return Promise.resolve(); }, setLoadingProgress: function(progress) { console.log('Loading: ' + progress + '%'); }, startGameAsync: function() { return Promise.resolve(); }, player: { getID: function() { return 'test_player_123'; }, getName: function() { return 'Test Player'; }, getPhoto: function() { return 'https://placekitten.com/100/100'; }, getDataAsync: function(keys) { return Promise.resolve({}); }, setDataAsync: function(data) { return Promise.resolve(); }, getConnectedPlayersAsync: function() { return Promise.resolve([]); }, getSignedPlayerInfoAsync: function() { return Promise.resolve({ getSignature: function() { return 'mock_signature'; } }); } }, context: { getID: function() { return null; }, getType: function() { return 'SOLO'; } }, getLocale: function() { return 'en_US'; }, getPlatform: function() { return 'WEB'; }, quit: function() { console.log('Game quit.'); } }; } - Test game logic independently. Use your mock to verify that game mechanics, animations, scoring, and UI work correctly. Platform-specific features (social, monetization) will need to be tested on the actual platform.
Testing on the platform
To test your game within the actual Facebook environment, you need to upload a build to the App Dashboard.
Uploading a test build
- Package your game as a ZIP file. Ensure that
index.htmlis at the root level of the ZIP (not inside a subdirectory). - Go to the App Dashboard and select your app.
- Navigate to Instant Games > Web Hosting.
- Click Upload Version and select your ZIP file.
- Wait for the upload and processing to complete. The dashboard will show the status of the build.
- Once processed, you can push the build to Development (accessible only to app team members) without affecting the live production build.
Playing your test build
Once a build is pushed to development:
- On web: Go to
https://www.facebook.com/embed/instantgames/YOUR_APP_ID/playerin your browser. ReplaceYOUR_APP_IDwith your app’s ID. - On mobile: Open the Facebook app on your iOS or Android device. Search for your game by name (if discoverable), or use a direct link shared from the App Dashboard.
- Via Messenger: Send a link to your game in a Messenger conversation to yourself, then open it.
Only users who are listed as administrators, developers, or testers on your app will be able to access development builds.
Using test users
Facebook provides test user accounts that you can use for testing without needing multiple real Facebook accounts. Test users are especially useful for testing social features.
Creating test users
- In the App Dashboard, navigate to Roles > Test Users.
- Click Create Test Users and specify how many you need.
- Each test user has a name, email, and password that you can use to log in.
What you can test with test users
- Social features: Make test users friends with each other, then verify that
getConnectedPlayersAsync()returns the expected players. - Sharing and updates: Test
shareAsync()andupdateAsync()between test users to verify that posts appear correctly. - Contexts: Use test users to test multiplayer contexts, challenges, and group play.
- Monetization: Use test users to test the IAP flow. See Testing monetization.
Limitations of test users
- Test users cannot interact with real Facebook accounts.
- Some platform features may behave differently for test users than for real users.
- Test users cannot access certain Facebook features, such as Groups and Pages.
Testing on different devices
Instant Games run on iOS, Android, and the desktop web. Each platform has its own runtime environment, and your game may behave differently across them. Test on all three.
iOS
- Open the Facebook app on an iPhone or iPad.
- Navigate to your game and launch it.
- Pay attention to:
- Performance: iOS WebView performance can differ from desktop browsers.
- Touch controls: Verify that all interactive elements respond correctly to touch input.
- Screen sizes: Test on different iPhone and iPad models, including devices with notches and rounded corners.
- Audio: iOS has specific restrictions on auto-playing audio. Audio typically must be triggered by a user interaction.
- Safe areas: Ensure your game UI does not overlap with the status bar, home indicator, or notch.
Android
- Open the Facebook app on an Android device.
- Test on both high-end and low-end devices. Low-end Android devices are common in many markets and may have limited memory, slower CPUs, and lower screen resolutions.
- Pay attention to:
- Performance on low-end devices: Games that run smoothly on high-end devices may lag or crash on older hardware.
- Screen sizes and densities: Android devices come in a wide variety of screen sizes and pixel densities.
- Back button behavior: Android has a hardware/software back button. Test how your game handles it.
- Memory constraints: Monitor memory usage, especially if your game loads many assets.
Desktop web
- Open your game at
https://www.facebook.com/embed/instantgames/YOUR_APP_ID/player. - Test in multiple browsers (Chrome, Firefox, Safari, Edge).
- Test with keyboard and mouse input if your game supports them.
- Test at different window sizes to ensure responsive layout.
Social features are a core part of Instant Games and require dedicated testing.
Connected players
- Create at least two test users and make them friends.
- Have both test users play your game (this registers them as connected players).
- Verify that
FBInstant.player.getConnectedPlayersAsync()returns the expected list. - Test your game’s UI for displaying friends, such as leaderboards and friend lists.
- Trigger a share in your game using
FBInstant.shareAsync(). - Verify that the share dialog appears with the correct image and text.
- Complete the share and verify that the post appears on the player’s timeline or in the conversation.
- Open the shared post from another test user’s perspective and verify that clicking it launches the game.
Context and challenges
- Use
FBInstant.context.chooseAsync()to select a friend or group. - Verify that the context switches correctly and that
FBInstant.context.getID()returns the new context ID. - Send an update using
FBInstant.updateAsync()and verify it appears to the other participants.
Tournaments
- Create a tournament using the SDK or App Dashboard.
- Have test users join and submit scores.
- Verify that the tournament leaderboard displays correctly.
- Test the full lifecycle: creation, joining, score submission, completion, and reward distribution.
Testing monetization
Testing in-app purchases (IAP)
In-app purchases require careful testing to ensure that the purchase flow, receipt verification, and item delivery all work correctly.
- Set up test products. In the App Dashboard, navigate to Instant Games > In-App Purchases and create test products.
- Use test users or developer accounts. Purchases made by app administrators, developers, and testers are not charged real money on most platforms.
- Test the complete flow:
- Load the product catalog with
FBInstant.payments.getCatalogAsync(). - Verify that products display with correct names, descriptions, and prices.
- Initiate a purchase with
FBInstant.payments.purchaseAsync(). - Verify that the purchase dialog appears correctly.
- Complete the purchase and verify that the purchase receipt is returned.
- If using server-side verification, verify that the receipt validates correctly on your server.
- For consumable products, test
FBInstant.payments.consumePurchaseAsync()and verify that the item is granted.
- Load the product catalog with
- Test error cases:
- Cancel a purchase mid-flow and verify that your game handles the cancellation gracefully.
- Test what happens if the network is interrupted during a purchase.
- Verify that
FBInstant.payments.getPurchasesAsync()correctly returns unconsumed purchases (useful for restoring purchases after a game restart).
Testing in-app advertising (IAA)
- Set up ad placement IDs. Create ad placements in the Monetization Manager. You will need separate placement IDs for rewarded videos, interstitials, and banners.
- Test ad loading:
- Call
FBInstant.getRewardedVideoAsync()orFBInstant.getInterstitialAdAsync()with your placement ID. - Call
loadAsync()on the returned ad instance. - Verify that the ad loads successfully (the promise resolves).
- Call
- Test ad display:
- Call
showAsync()to display the ad. - For rewarded videos, verify that the reward is granted after the video completes.
- For interstitials, verify that the game resumes correctly after the ad is dismissed.
- Call
- Test ad failures:
- Test what happens when no ad fill is available (the
loadAsync()promise rejects with aNO_FILLerror). Ensure your game handles this gracefully — for example, by hiding the “Watch Ad” button rather than showing an error. - Test with rate limiting in mind. Interstitial ads have a minimum interval between displays (typically 30 seconds). Verify that your game respects this.
- Test what happens when no ad fill is available (the
- Test banners:
- Call
FBInstant.getBannerAdAsync()to load a banner. - Verify that the banner appears in the correct position and does not overlap critical game UI.
- Call
Note: During development and testing, ad fill rates may be lower than in production. If ads are not loading during testing, it does not necessarily indicate a problem with your integration — there may simply be no available ad inventory for test traffic.
Debugging tools
Browser developer tools
When testing on the desktop web, your browser’s developer tools are your most powerful debugging resource.
- Console: View
console.log()output, errors, and warnings. Use the console to inspectFBInstantAPI responses. - Network tab: Monitor network requests to verify that your game is loading assets correctly and that any external server calls (if using Zero Permissions) are succeeding.
- Performance tab: Profile your game’s rendering and JavaScript execution to identify performance bottlenecks.
- Application tab: Inspect local storage, session storage, and indexed DB to debug data persistence issues.
FBInstant.logEvent for analytics
The SDK provides
FBInstant.logEvent() for sending analytics events that can be viewed in the App Dashboard:// Log a custom event FBInstant.logEvent( 'level_completed', // Event name 42, // Numeric value (e.g., score) { level: '5' } // Optional parameters (up to 25) );
Use
logEvent() to track key events during testing:- Level completions, with the level number and score.
- Tutorial completion rate.
- Ad impressions and rewarded ad completions.
- Purchase events.
- Error events (catch blocks in your game logic).
These events appear in the App Dashboard under Instant Games > Analytics and can help you verify that your game is sending data correctly.
Remote debugging on mobile
To debug your game running on a mobile device:
- Android: Connect your device to your computer via USB, enable USB debugging, and use Chrome’s
chrome://inspectpage to attach to the WebView running your game. This gives you full access to Chrome DevTools for the mobile session. - iOS: Connect your device to a Mac via USB, open Safari, and use Develop > [Device Name] to inspect the WebView. You will need to enable Web Inspector in your iOS device’s Safari settings.
Logging best practices
- Use
console.log(),console.warn(), andconsole.error()liberally during development to track game state and debug issues. - Wrap SDK calls in try/catch blocks and log errors:
try { var data = await FBInstant.player.getDataAsync(['level', 'score']); console.log('Player data loaded:', data); } catch (error) { console.error('Failed to load player data:', error); } - Before pushing to production, reduce or remove verbose logging to avoid leaking implementation details and to improve performance.
Common testing pitfalls
Forgetting to call startGameAsync()
If your game loads but the loading screen never disappears, you likely forgot to call
FBInstant.startGameAsync() or the promise chain leading to it is broken. Double-check that your initialization flow correctly calls initializeAsync() followed by startGameAsync().Testing only on desktop web
Many developers test exclusively in their desktop browser because it is the most convenient environment. However, mobile is where the majority of Instant Games players are. Games that work perfectly on desktop frequently have issues on mobile: touch controls may not work, performance may be poor, layout may break on small screens, and audio may not play. Always test on real mobile devices.
Not testing with slow networks
Many players, especially in emerging markets, have slow or unreliable internet connections. Test your game on a throttled connection (you can simulate this using browser developer tools under the Network tab) to verify that:
- Loading progress is reported correctly.
- The game handles network timeouts gracefully.
- External API calls (if using Zero Permissions) have appropriate retry logic.
Forgetting to handle API rejections
All
FBInstant async APIs return promises that can reject. Common reasons for rejection include:USER_INPUT: The player cancelled an action (share, purchase, context selection).NETWORK_FAILURE: A network request failed.INVALID_PARAM: An API was called with invalid arguments.CLIENT_UNSUPPORTED: The API is not available on the current platform or SDK version.
If you do not catch these rejections, they will appear as unhandled promise rejections and may cause unexpected behavior. Always add
.catch() handlers:FBInstant.shareAsync({ intent: 'SHARE', image: base64Image, text: 'Check out my score!' }).then(function() { console.log('Share completed'); }).catch(function(error) { // Player may have cancelled the share. Handle gracefully. console.log('Share did not complete:', error.code); });
Not verifying bundle structure
A common upload failure is having
index.html inside a subdirectory in the ZIP file rather than at the root. When you create your ZIP, make sure the structure looks like this:my-game.zip
index.html
fbapp-config.json
game.js
assets/
sprite.png
sound.mp3
And not like this:
my-game.zip
my-game/
index.html
fbapp-config.json
game.js
assets/
sprite.png
sound.mp3
Testing monetization with real accounts
Be cautious when testing in-app purchases with real Facebook accounts that have real payment methods attached. While developers and testers are generally not charged for test purchases, verify this for your specific configuration before testing. Use test users when possible.
Pre-launch testing checklist
Before pushing your game to production, verify the following:
- Game loads in under 5 seconds on a mid-range device with an average network connection.
- Loading progress bar advances smoothly (using
setLoadingProgress()). - Game plays correctly on iOS, Android, and desktop web.
- Tutorial is clear, functional, and completable in under 30 seconds.
- All social features work (connected players, sharing, challenges, tournaments).
- In-app purchases complete successfully and items are delivered.
- Ads load and display at natural break points without disrupting gameplay.
- The game handles ad load failures gracefully (e.g., hides ad buttons when no fill is available).
- Player data saves and loads correctly across sessions.
- The game handles network interruptions gracefully.
- No console errors or unhandled promise rejections.
- The game respects orientation settings configured in
fbapp-config.json. - All game assets are optimized (compressed images, minified JavaScript).
- No verbose debug logging in the production build.
Next steps
- Bundle Configuration — Configure platform behaviors with
fbapp-config.json. - Game Performance — Optimize your game’s loading time and runtime performance.
- Quality Guidelines — Review the requirements your game must meet before going live.
- SDK Reference — Full API documentation for the Instant Games SDK.