# Debug

## Using debug mode

When debug mode is enabled, exceptions will be thrown when the tracker is not started properly.&#x20;

{% hint style="info" %}
**Note:** When you are ready to submit the app for review, remember to disable debug mode.
{% endhint %}

### Enable debug mode for iOS

For iOS, you can switch between logging tiers to see output from the tracker to help you with integration. There are four logging tiers:

* **verbose:** output everything
* **debug:** output debug related info, warning and error
* **warning:** output warnings and errors
* **error:** output errors (see property `loglevel`)

All log output has the format `[CB]: xxxx`

#### **Objective-C**

```objectivec
[CBTracker sharedTracker].debugMode = true;
[CBTracker sharedTracker].logLevel = CBTrackerLogLevelVerbose;i
```

#### **Swift**

```objectivec
CBTracker.shared().debugMode = true
CBTracker.shared().logLevel = .verbose
```

### Enable debug mode for Android

Set `com.chartbeat.androidsdk.DEBUG` to true before your first call to `setupTracker`.

### Enable debug mode for React Native

#### Turn on verbose native logs

```
Chartbeat.setDebugMode(true);
```

Call this immediately after setupTracker.

#### iOS — view native logs

Open **Console.app**, filter by the iOS Simulator process, and search for Chartbeat-related messages, or stream from the terminal:

```
xcrun simctl spawn booted log stream --level debug --style compact \
  --predicate 'eventMessage CONTAINS "[CB]:Pinging"'
```

#### Android — view native logs

Open **Logcat** in Android Studio, or stream from the terminal:

```
adb logcat -T 1 | grep -i pingclient
```

## Example Pings

#### Android

Example URL from View Tracking:

`https://ping.chartbeat.net/ping?h=androidsdktest.chartbeat.com&p=/korean-peace-talks.html&u=ZVEmdQVqqa00J71RvO&d=androidsdktest.chartbeat.com&g=1&_acct=anon&n=0&f=F0001&c=0.00&j=30&R=1&W=0&I=0&E=1&e=1&v=/&t=iDg9zmv4Loy0zmVOLd7-heiOfhvyE5&V=2013&D=ssShUwV_bK51dFzrQFHtCGtOyCMLbL&i=Sec. Schwartz Attends Korean Peace Talks&tz=-240&S=426&Z=1&sr=push/?id%3D123456a&sd=2&sv=fbgnceXLZMJwM2wgCUftDJopJb8D&_`

**Breakdown:**

```
https://pong.chartbeat.net/ping?
h=androidsdktest.chartbeat.com
p=/korean-peace-talks.html
u=ZVEmdQVqqa00J71RvO
d=androidsdktest.chartbeat.com
g=1
_acct=anon
n=0
f=F0001
c=0.00
j=30
R=1
W=0
I=0
E=1
e=1
v=/
t=iDg9zmv4Loy0zmVOLd7-heiOfhvyE5
V=2013
D=ssShUwV_bK51dFzrQFHtCGtOyCMLbL
i=Sec.%20Schwartz%20Attends%20Korean%20Peace%20Talks
tz=-240
S=426
Z=1
sr=push/?id%3D123456a
sd=2
sv=fbgnceXLZMJwM2wgCUftDJopJb8D
_
```

#### iOS

Example URL from View Tracking

`https://ping.chartbeat.net/ping?p=nonVideo/sharks-win-big.html&c=0.25&V=1014&I=0&sv=eS1kOVVKRUVTX2FpU0ptdm1jR0dCZ19f&e=11&W=1&f=a0601&t=NW5wTGJDbk9SR3lrdGR6Qk1SVHBvZ19f&g=54876&u=VkhrMzkwVFFSdVdFTH&Z=1&h=iphonesdktest.chartbeat.com&i=Sharks Win Big. Mets%2C Knicks Lose Again&j=30&x=0&y=2622&sr=&m=0&R=0&E=11&o=1206&sd=8&_`

**Breakdown:**

```
https://ping.chartbeat.net/ping?
p=nonVideo/sharks-win-big.html
c=0.25
V=1014
I=0
sv=eS1kOVVKRUVTX2FpU0ptdm1jR0dCZ19f
e=11
W=1
f=a0601
t=NW5wTGJDbk9SR3lrdGR6Qk1SVHBvZ19f
g=54876
u=VkhrMzkwVFFSdVdFTH
Z=1
h=iphonesdktest.chartbeat.com
i=Sharks%20Win%20Big.%20Mets%2C%20Knicks%20Lose%20Again
j=30
x=0
y=2622
sr=
m=0
R=0
E=11
o=1206
sd=8
_
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chartbeat.com/cbp/tracking/mobile-app-sdks/qa-mobile-sdk-integration/debug.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
