How can I root LG G3 What do I have to do to root my LG G3?

There are multiple variants of this device:


D855 : International Version
D850 : AT&amp;T
D851 : T-Mobile
VS985 : Verizon
LS990 : Sprint / US Cellular


To add to the How do I root my Android Device
DISCLAIMER: ROOTING YOUR PHONE WILL PROBABLY VOID YOUR WARRANTY FROM BOTH THE CARRIER AND THE MANUFACTURER. IF YOU DO NOT WISH TO ACCEPT FAULT FOR ANY ADVERSE EFFECTS OF ROOTING, THEN DO NOT READ ANY FURTHER. HERE BE DRAGONS.



For more information, and other devices see How do I root my Android device.

PurpleDrake is a set of scripts that will root your LG G3 device and optionally install TWRP recovery by TeamWin. 

It works with just about all variants of the LG G3. You can see the PurpleDrake supported devices in their spreadsheet on Google Docs.

TWRP will allow you to easily apply new ROMs to your device. Which is especially helpful, since it is recommended that after you root you should disable OTAs. 


You will need the USB drivers if you are on Windows:


Verizon
All other models

Download PurpleDrake Scripts (currently R03)
Extract the files to a folder you can easily get to. 
Open the folder 
Run PurpleDrake


a. OSX: Doubleclick purpledrake_osx
b. Linux: In a terminal.


chmod +x purpledrake_linux.sh
./purpledrake_linux.sh

c. Windows: Doubleclick purpledrake_windows

Follow the instructions from within PurpleDrake.
After running PurpleDrake, you will still have to install an app like SuperSU, as PurpleDrake does not include one. 
Disable OTA [Source]


You will probably want to disable the OTA's. From here on out, if you get an update Over-The-Air, you may lose root, or worse, your unlocked bootloader.
From Dialer: 3845#*851# [Replace 851 with your device model number, 850, 855, 990]
Go to WLAN Test => OTA Setting => OFF



If you install TWRP, then you must be aware, you may run in to issues if you do not disable OTAs.

Some "patches" that come down from the carrier will still notify you even if OTAs is disabled. DO NOT INSTALL OTAs IF YOU INSTALL TWRP, YOU WILL GET STUCK IN A RECOVERY LOOP.

If you get stuck in a Recovery Loop because of an OTA, do not panic, these things always have a fix.

From the TWRP recovery terminal commands enter the following:


  dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
  PRESS ENTER, THEN TYPE
  dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc
  PRESS ENTER  
  
  REBOOT