How to Program Mercedes GLS X166 Key with LAUNCH X431 (2026 Guide)

Step-by-step guide to programming a new key for Mercedes-Benz GLS-Class X166 using LAUNCH X431. Includes security code, troubleshooting, and no-key solutions.

Published: May 28, 2026

Quick Answer: Programming Your Mercedes GLS X166 Key

Programming a new key for a Mercedes-Benz GLS-Class (X166) with a LAUNCH X431 scanner requires J2534 Pass-Thru programming and an active online subscription to fetch a 16-digit security code. You will need at least two existing working keys to begin. The process involves connecting the scanner, selecting the Immobilizer or Key Learning function under the GLS-Class X166 menu, entering the security code, and following the on-screen key insertion sequence. After the new key is learned, test all functions — if remote lock/unlock fails, a separate RF synchronization step may be needed.

Important: You cannot program a brand-new key if you have zero existing working keys. In that case, you will need dealer-level software (Mercedes-Benz Star Diagnosis) or a professional automotive locksmith.

Why This Procedure is Different (The X166 Context)

Programming a key for the Mercedes-Benz GLS X166 isn't like the simpler procedures on older Mercedes models. Here is what makes it unique:

  1. The "Pass-Thru" Requirement – Unlike pre-2010 Mercedes models, the X166’s Electronic Ignition Switch (EIS) module requires secure online verification. The LAUNCH X431 acts as a pass-thru device, communicating with Mercedes’ server to authenticate the new key. Without an active LAUNCH subscription and a stable internet connection, the process will not work.

  2. The "Two-Key" Rule – Most X166 EIS modules demand that at least two original, working keys be present inside the vehicle during the learning sequence. If you only have one working key, you will still be able to program a second, but if you lose all keys, you cannot use a LAUNCH X431 to add a new one (see the "No Original Keys" section below).

  3. Hardware Dependence – Not all LAUNCH X431 models support this procedure. The X431 V+, PRO5, and PAD series (including PAD VII) have the necessary processing power and licensed Mercedes-Benz software. Older units like the Creader or X431 IV may not include the pass-thru programming module. Always check your tool’s coverage list before starting.

Prerequisites & Preparation

Before you even touch the LAUNCH X431, make sure everything is in order. Skipping these checks is the most common reason for failed programming attempts.

  • Tool Compatibility – Confirm that your LAUNCH X431 has the latest Mercedes-Benz software package installed and that your subscription includes Online Programming (sometimes called "SmartLink" or "Cloud Programming"). Without it, you won’t be able to generate the security code.

  • Battery Condition – The vehicle battery must be fully charged (12.6V or higher) and stable. A voltage drop during the learning process can corrupt the EIS module, requiring a replacement. I recommend connecting a battery maintainer or a jumper pack to the 12V battery to keep voltage steady.

  • Key Type Identification – Determine whether you have a Smart Key (Keyless Go) or a standard IR (infrared) key. The X166 generally uses Smart Keys with a physical emergency blade. The LAUNCH X431 will ask you to select the key type, so have this information ready.

  • Blank Key Status – The new key must be a virgin blank — meaning it has never been programmed to any vehicle. If you bought a used key from eBay, it will be rejected until a locksmith or dealer erases its old data (a process called "virginization").

Step-by-Step: Programming Process

Follow these steps exactly as written. If you deviate, you risk locking the EIS module or wasting a security code credit.

Step 1: Connect and Identify

  1. Insert your LAUNCH X431 diagnostic tablet into the docking station (if using a modular unit) or power on the tablet directly.
  2. Plug the OBD-II cable into the vehicle’s diagnostic port — located under the driver’s side dashboard, near the hood release.
  3. Turn the ignition to ON (position 2). Do not start the engine.
  4. On the tablet, open the Mercedes-Benz diagnostic application.

Step 2: Select the Correct Model

  1. Allow the LAUNCH X431 to perform an Auto Scan (VIN recognition). This is the safest option because it eliminates the risk of selecting the wrong chassis.
  2. If Auto Scan fails, manually navigate: Model SelectionGLS-ClassX166 (model years 2013–2019).
  3. Once the vehicle is identified, select the EIS (Electronic Ignition Switch) or Keyless Go Module from the system list.

Step 3: Enter the Special Function Menu

  1. Scroll down to the Special Functions menu.
  2. Look for either Key Learning or Program New Key — the exact label may vary slightly depending on your software version.

Step 4: The Security Code Entry

At this point, the LAUNCH X431 will prompt you for a Security Code (PIN) . This step is where most DIYers get stuck.

  • How to get it: You must purchase the security code through the X431 Cloud or your LAUNCH subscription package. The code is a 16-digit number that is generated specifically for your vehicle’s VIN.
  • Where to enter: Type the exact 16-digit code when prompted. One wrong digit will cancel the procedure, and you may need to purchase a new code.

Step 5: Key Insertion Sequence

This sequence is critical. Follow the on-screen instructions, but here is the standard workflow for the X166:

  1. Insert existing key #1 into the ignition slot (or bring it near the steering column if it’s a Keyless Go model). Turn to position 2 (ignition on). Wait 3 seconds. Remove the key.
  2. Insert existing key #2. Turn to position 2. Wait 3 seconds. Remove the key.
  3. Insert the new blank key. Turn to position 2. The system will authenticate the blank key.
  4. Wait for confirmation. The instrument cluster may display "Key Learned" or the parking lights will flash once.

Step 6: Verification

  1. Remove the new key and test all functions:
    • Lock/Unlock — press the remote buttons.
    • Keyless Go — approach the vehicle and touch the door handle.
    • Engine Start — press the brake and push the start button.
  2. If the engine starts but remote lock/unlock does not work, you need to perform an RF Key Synchronization (see Troubleshooting below).
  3. Important: If you are adding a third key, you must repeat steps 4 (security code) and 5 (insertion sequence) — the EIS only learns one new key per session.

Troubleshooting Common Failures

Even with careful execution, things can go wrong. Here are the most common errors and how to fix them.

  • Error: "Security Code Invalid"

    • Cause: You either entered the code incorrectly, or you purchased the wrong code type (e.g., a generic BMW code instead of the Mercedes W166/X166 code).
    • Fix: Double-check the 16-digit string. If it still fails, contact LAUNCH support and ensure you selected the correct vehicle model when purchasing.
  • Error: "Communication Fault"

    • Cause: Loose OBD-II connection, low battery voltage, or a faulty cable.
    • Fix: Push the OBD connector firmly into the port. Connect a battery maintainer to stabilize voltage. If the error persists, try a different OBD cable or docking station.
  • Error: "Maximum Keys Programmed"

    • Cause: The EIS module can store up to 8 keys. If you are trying to add a ninth key, it will be rejected.
    • Fix: You must delete all keys and re-learn them. This requires a professional locksmith with Mercedes-Benz Star Diagnosis, because the LAUNCH X431 does not support full key erasure.
  • Engine Starts but No Remote Function

    • Cause: The key was learned by the EIS (ignition) but not paired to the RF (Radio Frequency) Module (also called the Keyless Go antenna).
    • Fix: Go to Body Control Module > Special Functions > RF Key Synchronization. Follow the on-screen steps — this typically involves turning the key to position 2 and pressing the lock button three times.

The "No Original Keys" Scenario

If you have lost all keys, the LAUNCH X431 cannot help you directly. The device requires at least one valid key in the vehicle to authenticate the programming session. Here are your realistic options:

  • Send out the EIS module – A specialized locksmith or service center can extract the EIS from the vehicle, virginize it, and program new keys. This is expensive (usually $200–$500) but reliable.
  • Dealer visit – Mercedes-Benz dealerships can order keys by VIN and program them with Star Diagnosis. This is the most expensive option, but the only way to guarantee OEM parts.
  • LAUNCH Online Simulator mode – Some advanced LAUNCH subscriptions offer an "Online Simulator" that can bypass the key requirement. However, this is rare, costly, and not available in all regions.

Frequently Asked Questions (FAQ)

Can I program a used X166 key with my LAUNCH X431?

No. A used key contains residual data from its previous vehicle. The EIS will reject it. You must have the key virginized (erased) by a professional locksmith or dealer before it can be learned to your GLS. Always buy a brand-new blank key from a trusted source.

Does the LAUNCH X431 require internet to program?

Yes. For the X166, the security code retrieval (Step 4) requires a live internet connection via Wi-Fi or mobile hotspot to access LAUNCH’s server. The actual key learning process itself does not need constant internet, but the initial code generation does. Ensure you have a stable connection.

How long does the entire process take?

The on-vehicle programming steps take 5–10 minutes. However, waiting for the software to download the key file, generating the security code, and troubleshooting any errors can add 15–20 minutes. Budget about 30 minutes total.

Is it safe to program the key myself, or should I use a dealer?

It is safe as long as you follow the steps exactly and ensure the battery is stable. The main risk is a sudden battery voltage drop during the write cycle, which can corrupt the EIS module. If you are not confident in maintaining battery voltage, use a professional. Otherwise, the LAUNCH X431 makes this a straightforward DIY job.

Which LAUNCH X431 model is best for Mercedes keys?

The X431 V+ and X431 PRO5 offer the best balance of price and Mercedes coverage. The X431 PAD VII works perfectly but is overkill for key programming alone. Avoid the Creader and X431 IV as they lack the pass-thru programming capability.

What if I have the X164 model (older GLS)?

The X164 chassis (2007–2012) does not require online pass-thru programming. It uses a simpler key learning process under the Imobilizer menu, and it does not need a 16-digit security code. If you own an earlier GLS, the procedure is much easier.


About the Author: Erwin Salarda is an Automotive Service Equipment Technician based in the Philippines, specializing in computerized automotive diagnostic equipment such as OBD scanners and wheel alignment systems. Since 2012, he has been actively providing technical support, equipment installation, troubleshooting, after-sales service, and hands-on training for automotive service equipment used by workshops and automotive professionals.

He has received specialized training from international suppliers and manufacturers, including Launch X431 in Shenzhen, China, Lawrence Engineering Company in Guangzhou, China, and 3Excel Wheel Alignment Company in Shenzhen, China. Through these trainings, he developed advanced expertise in automotive diagnostics, calibration, wheel alignment systems, and computerized automotive service technologies.

Erwin Salarda provides professional after-sales support and technical training for automotive diagnostic and wheel alignment equipment, helping clients maximize the performance and proper use of their tools and systems. His experience covers equipment setup, software updates, calibration procedures, troubleshooting, and operational guidance for automotive workshops and service centers.

With more than a decade of experience in the automotive equipment industry, Erwin Salarda continues to support automotive businesses by delivering reliable technical expertise and practical training solutions.

For inquiries and equipment purchases, please visit https://carlifterph.com/


Related Posts