> install Lineage OS on Samsung Galaxy S4 GT-I9505:
The following instructions are for Windows only. Please don't use a virtual machine as these can cause problems communicating with the device. ...
First we need to download the tool that flashes to the devices different partitions.
On most devices you use a tool called fastboot, but Samsung devices aren't like most devices.
This tool is called Odin, it's Windows only and leaked from Samsung so you need to get it from a trusted source.
You can download the latest version (as of 5/5/2017)
Extract the "Odin_3.12.3.zip" file. You should now have a folder called "Odin_3.12.3".
Treat this as your working directory and download all other files to this folder.
You don't need a PIT file for your phone.
GT-i9505 is same as "Qualcomm" version of phone.
Now we need to download Team Win Recovery Project, or TWRP as most people call it.
TWRP is a custom recovery. A recovery is a mini-OS that is stored on another partition of the device that can do basic
functions like flashing and wiping. TWRP is one of the more full featured recoveries as it has stuff like backup
and restore built in. Devices do have stock recoveries but these are programmed to only flash files signed by the vendor,
people don't often notice this but stock recovery is what the device uses when you run an OTA (Over The Air) update or a factory reset.
You can get the latest version (as of 5/5/2017) of TWRP for your device
Make sure to click "Download twrp-3.1.0-0-jfltexx.img.tar" to download the actual file.
Now we need to download the Android platform tools. These contain multiple tools (including fastboot as I mentioned earlier)
but we are after ADB (Android Debug Bridge). It has multiple use cases and can be used in recovery or just in the normal Android system.
You can download the latest version (as of 5/5/2017) of the platform tools for Windows
Extract the "platform-tools-latest-windows.zip" file and there should be a "platform-tools" folder. Open this folder and move
its contents into the "Odin_3.12.3" folder from before.
Now to download LineageOS itself. Custom ROMs, along with a bunch of other things come in a flashable zip format that
gets flashed using a custom recovery. LineageOS has two build types as of now, one is an experimental migration build,
and the other is the normal build. As you're doing a clean install you need the normal build.
Please keep in mind stability isn't promised and it is recommended to keep TWRP backups.
You can get the latest build (as of 5/5/2017) for your device
The next file we need is Gapps (well we don't actually need it but the majority use it). Gapps (Google Apps) are basically all
the Google branded apps like the Play Store and it's needed services. They come in multiple variants depending on how many
Google Apps you want. I usually recommend either the stock package (installs Google Apps like it's on a Nexus) or the nano package
which is smaller and installs just the needed apps. You can get the latest nano package for your device
Or the latest stock package
Also, if you would like to have root access you will need to download the optional root add-on from
Keep in mind if you want SafetyNet to pass you would need to use an unofficial root method like Magisk.
Now to prepare the device to be flashed. Go into settings and look for "Developer Options" or something along those lines.
If it isn't there, go into "About phone" and tap "Build number" 7 times. Then go back up into settings.
They should be there now. Enable "Developer Options" (if it has a toggle) then enable "USB Debugging".
This allows us to use ADB on the stock ROM but it usually isn't needed (we enable it just in case).
Also enable "OEM Unlock" if it's there, this would allow us to flash unsigned images to the device
however not all builds have this setting so you may not need to enable it. Also go back into security
settings and disable "Reactivation Lock" if you can, because sometimes it can cause issues.
Once you have these options set, say goodbye to your stock ROM and just pull your battery.
Reinsert the battery and then hold the Volume Down, Home, and Power keys. This should put the device into download mode;
hold the keys until you see that.
Accept any warnings then plug the device in. Open "Odin.exe" from the "Odin_3.12.3" folder. In the log,
it should say Added! and have a blue COM thing near the top, meaning it detected your device.
If it didn't detect it, then tell me because that means you probably have a driver issue.
Click the "Option" tab and make sure "F. Reset Time" and "Auto Reboot" is enabled.
Also check the checkbox next to the "AP" button and then click the button.
Select the "twrp-3.1.0-0-jfltexx.img.tar" file. Now on the device, hold the Volume Up and Home keys
and click "Start" in Odin. Normally the key combo to get into recovery is Volume Up, Home, and Power but
since Odin is going to auto reboot the device when it finishes flashing we don't need to use the Power button.
If it's too hard to click "Start" at the same time as holding the buttons.
You can just disable "Auto Reboot" and click "Start". Once Odin says "RESET" or "PASS" near the top
and says it successfully flashed in the log. You can then just hold the Volume Up, Home, and Power keys.
Whatever method you choose, keep holding the keys until you see the Team Win Recovery Project (TWRP) splash screen.
It's going to ask you if you want to modify the system, you can just allow it to do this by swiping the slider.
It may also ask you anytime during the process if you want to root, don't let it do this.
Now click "Wipe", "Advanced Wipe", select "System", "Data", and "Cache",
and then swipe the slider. This clears the partition that user data is stored in,
along with the caches. Once that finishes you can click the home button. Now click "Advanced" and click "ADB Sideload".
Swipe the slider, you don't need to wait for it to start as it will start once it gets the command from your computer.
Open a command prompt Window up to the "Odin_3.12.3" folder and run "adb devices". After the message about starting the daemon you should see
something like "SERIALNUMBER sideload". If you don't then tell me because that means there is probably a driver issue.
There is multiple methods to flash with TWRP but this is my favorite as it doesn't leave the files on the device.
Now just run "adb sideload lineage-14.1-20170503-nightly-jfltexx-signed.zip" to flash it.
The percentage is inaccurate so don't worry if it goes over 100%. TWRP will say once it finishes.
Don't reboot yet though, we still need to flash Gapps. Click the home button and go back to the ADB Sideload menu.
Swipe the slider and this time run the same command but for the Gapps file ("adb sideload open_gapps-arm-7.1-full-20170505.zip" in my case).
If you want root,
do the same step for the root add-on ("adb sideload addonsu-arm-signed.zip" in my case) once Gapps is done flashing.
Now you can "Reboot System" to reboot into LineageOS. You should now see the LineageOS boot animation.
The first boot may take up to 15 minutes but you should soon be seeing the setup wizard where you can continue like you normally would.
If it doesn't boot, tell me.
If you flashed the root add-on don't forget to enable it in developer settings.