Disable Production Devices From Connecting To A/B Test Designer

By default, Mixpanel A/B testing is enabled in the Mixpanel iOS and Android SDKs, which means any device with your app has the potential to connect to the Mixpanel A/B test designer unless you explicitly remove this ability in your production builds.

Mixpanel uses websockets for the A/B test designer, which means only one connection can happen at a time. If somehow users’ devices are accidentally connecting to the A/B test designer, that means you may be blocked from creating an A/B test (as you will not be able to connect to the designer with your device).

If you’re unable to connect to the A/B test designer due to a connected production device

If you’re currently blocked by not being able to connect to the A/B test designer due to inadvertent connection to the tester by a production device, you can try forcing your app to connect by setting the preprocessor macro DEBUG=1 in your current build (iOS only). This will force the app to attempt to connect every couple of seconds to the websocket. It might take several attempts to beat out other device(s) trying to connect, but it will try the connection every couple of seconds.

Long-term fix for Android

To prevent production devices from inadvertently connecting to the A/B test designer, simply add a line to your AndroidManifest.xml file which removes this default behavior:

<meta-data android:name="com.mixpanel.android.MPConfig.DisableGestureBindingUI" android:value="true" />

If you would like to prevent emulated devices from connecting to the A/B test designer you can add the following line to your AndroidManifest.xml file:

<meta-data android:name="com.mixpanel.android.MPConfig.DisableEmulatorBindingUI" android:value="true" />

Long-term fix for iOS

On iOS, there is less likelihood of your users connecting to the A/B test designer by accident since it takes the more unnatural four finger touch for there to be a connection. However, you can still disable it in production by adding a line to the preprocessor macros for your podfile:



You may also make an explicit call to [mixpanel setEnableVisualABTestAndCodeless: NO];oracallto mixpanel.enableVisualEditorForCodeless = false in our Swift SDK.

What do I do if I still cannot connect?

If you have inadvertently enabled this feature, and remain unable to connect in any way due to production devices connecting to the designer, please email support@mixpanel.com to work out a solution specific to your use case.

Find your answer?
0 out of 0 found this helpful



Article is closed for comments.