---
title: AdMob
description: >-
  AdMob Cocos2dx guide for Custom Adapter (GMA SDK).
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

## Prerequisites

*Performed by: Developer*

* See the [Compatibility Matrix](/reference/compatibility-matrix) for the minimum Android and iOS versions for this package.


## Install the SDK

*Performed by: Developer*

1. **Install the toolchain**  
   CMake **3.6** or newer, Python **3**, and Node.js **18+** for the adapter installer.  
   For Android: Android Studio with SDK **34** and NDK **21.4.7075529**.  
   For iOS: Xcode with command line tools, plus CocoaPods.

2. **Get the engine**  
   Download the Cocos2d-x **4.0** release and unpack it into your project as `cocos2d/`.

3. **Fetch the prebuilt dependencies**  
   The engine ships without its third-party binaries. Run this from inside `cocos2d/`, or the CMake configure step will fail on missing headers.

```
python download-deps.py
```

   Clone the TapMind Cocos2dx AdMob adapter installer: [cocos-2dx-custom-adapter-admob-gma](https://github.com/tapmind-tech/cocos-2dx-custom-adapter-admob-gma.git)

4. **Generate and build — Android**  
   Open `proj.android/` in Android Studio and run, or build from the command line. Gradle drives CMake for the native layer.

```
cd proj.android && ./gradlew assembleDebug
```

5. **Generate and build — iOS**  
   CMake generates the Xcode project; CocoaPods then integrates the pods into a workspace. Open the **workspace**, never the `.xcodeproj`.

```
cmake -S . -B proj.ios_mac/build -GXcode \
  -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos \
  -DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=15.0
```

6. **Add the adapter**  
   Run the installer against your game root — the folder holding `proj.android/` and `proj.ios_mac/`. It writes the Gradle dependency and the Podfile entry between managed markers.

```
node inject.js --project /path/to/game [--platform android|ios|all]
```

It wires the dependency only. The Google Mobile Ads SDK arrives transitively, but your AdMob App ID and all load/show code are yours to add.

7. **Run Pod**

```
cd proj.ios_mac && pod install
open CocosSampleProject.xcworkspace
```

**App ID Configuration:**
Ensure the **App ID used in the application matches the App ID configured for TapMind in the AdMob mediation/waterfall**. Using a different App ID may prevent the **TapMind SDK from initializing correctly**.

## Configure AdMob

*Performed by: Ad ops*

Refer [AdMob Mediation Integration Setup](/reference/mediation-integration-setup/admob) for the integration.

Refer **[Class & Network Key Registry](/reference/class-network-key-registry)** for the classnames.

## Verify integration

*Performed by: Developer*

After install and dashboard configuration:

1. Run your app in a **debug** build. TapMind's test mode is enabled automatically in debug builds and serves test ads at a high fill rate.
2. Request an ad through your mediation SDK as you normally would.
3. Confirm a TapMind ad fills. Check logs for the tag **`TapMindAdapter`**.
4. When verified, build in **release** mode for production - test mode is disabled automatically in release builds, and live ads serve.

**Note:** Test mode is automatic. It follows your build type: debug = test ads, release = live ads. There is no flag to enable or disable, and nothing to turn off before going live.

**Release build QA:** There is currently no documented release-safe test path to validate R8/ProGuard without serving live ads. Consumer ProGuard rules from the TapMind AAR are applied automatically when you integrate the published adapter packages.

## Troubleshooting

*Performed by: Developer*

Before diving into logs, confirm adapter class names and the LevelPlay network key against the [Class & Network Key Registry](/reference/class-network-key-registry), **placementName**, **placementcode** and **eCPM/rate** with your account manager.

See [Troubleshooting](/reference/troubleshooting) for common symptoms, mediation-specific fixes, release vs debug guidance, and escalation steps. Partner-specific verification steps are under **Verify integration** above.
