yashsingh1/xdaforums huggingface dataset:
[Moto Z2 Force  Guides, News, & Discussion] Technical:
A. Opening bootloader

With enough battery in your phone (80%), you can follow the Motorola official guide which steps are:

1. Backup everything you need. Your phone will be reseted including the internal sdcard.

2. Into the phone, enable the Developer Options clicking 7 times over the version (About section in the Settings). Go to Developer Options, click the OEM unlock option to enable it. Also enable USB debugging.

3. Install the Motorola drivers in your computer, but (in my personal experience) not the Android SDK suggested in the official guide. Instead, extract these adb/fastboot files in a blank folder of your computer.

3.1) Do not use other adb/fastboot binaries: I cannot guarantee they will work.

3.2) You need to use a USB 2.0 port of your computer. Some users report that USB 3.0 will also work.

4. Open a command line window in the adb/fastboot folder (step 3), reboot the phone into the bootloader (see adb command below or press power + volume down buttons). Plug the phone on computer (see 3.2 above). Test the connection and run the command to get the code for unlocking:

adb reboot bootloader
fastboot devices
fastboot oem get_unlock_data

You’ll get:

(bootloader) Unlock data:
(bootloader) <code 1>
(bootloader) <code 2>
(bootloader) <code 3>
(bootloader) <code 4>
(bootloader) <code 5>

5. You’ll need to join 5 codes and, after logging into your own Motorola account, check by clicking the button “Can my device be unlocked” (step 6) by Motorola here. Read the text: your warranty will be void if you go ahead. Consider if you have enough knowledge, time and money to deal with a troublesome (or bricked) device. Although, it’s not that easy to hard brick this phone (see process E below).

<code 1><code 2><code 3><code 4><code 5>

6. You’ll receive back an email with the code to unlock your bootloader (if it is available for your model). Then you’ll run the following command:

fastboot oem unlock <code 1><code 2><code 3><code 4><code 5>

7. You’ll receive a warning that all your data would be erased (see step 1 above) and need to re-run the same command to confirm. At this point, your bootloader should be unlocked. As an Android restriction, each time you boot the phone you’ll see a warning. Do nothing, wait for 5 seconds and the phone boots normally. Some users bother with this warning and try to get rid of it.
[Moto Z2 Force  Guides, News, & Discussion] Technical:
C. Flashing a custom AOSP ROM + rooting

1. Requirements:

1.1 Motorola drivers.

1.2 Our custom adb/fastboot files (others may not work!).

1.3 USB debugging enabled into the Developer Options.

1.4 If you're using TWRP older than 3.2.2-2, disable disable PIN/gestures/fingerprinting. Also, most probably, ROMs after July 20th, 2018 cannot be flashed in older TWRP.

1.5 An USB 2.0 port of your computer (some users report that USB 3.0 will also work).

1.6 Two Oreo bootloaders (process B above).

1.7 Permanent TWRP

1.8 Enough battery in your phone (80%).

2. Download the AOSP ROM you want and move the .zip files to the phone. Right now, we have:

2.1 Dirty Unicorns: no need for Gapps. Official and Weeklies can be dirty flashed interchangeably. RC has a different signature. Support on Google+ page. More about DU kernel.

2.2 Lineage OS 15.1. MindTheGapps needed. OpenGapps not compatible yet. XDA thread.

2.3 Mokee: Gapps needed. Take care: online guides assume that you already have an AOSP ROM, TWRP and rooted device.

Deprecated (?)

2.4 AOSiP: no need for Gapps. XDA thread.

2.5 Invictrix. Gapps are built in. XDA thread

3. Choose the root method and download the .zip files: Magisk (suggested) or LineageOS SU Addon. Move the .zip files to phone. Note: if you bootloop on Magisk, most probably you’re flashing a wrong/different version of Magisk or you did not reboot between flashing ROM/Gapps and Magisk. Note: SuperSu is deprecated.

4. Reboot into TWRP:

adb reboot recovery

Then flash the ROM. It will be flashed in two steps only in the “other” slot. We have two slots, A and B. Our phone can be upgraded on-the-fly because the update is always applied to the slot not booted, the “other” slot. Then, immediately, flash the .zip TWRP or you will lose it.

5. Go to Reboot menu of TWRP and reboot into bootloader. Then, in the folder with adb/fastboot binaries (see 1.2 above), you need to wipe data (including sdcard) with the following commands:

fastboot devices
fastboot -w

6. Now you need to reboot the phone into System using the buttons volume up/down and confirming with the Power button (or typing fastboot reboot into the command line windows). You’ll be with an AOSP ROM and TWRP.

7. Once into the phone, enable the Developer Options clicking 7 times over the version (About section in the settings). Go to Developer Options and enable USB debugging if you intend to dirty flash ROM updates.

8. Reboot into TWRP again, flash Magisk (your settings and modules will be preserved). Note: if you bootloop on Magisk, remember it is mandatory to reboot between ROM flash (step 4 above) and GApps/Addon flash due to verity/slot-swap logic.

9. A good place to read what is

not

working is in the section known problems of LineageOS.
[Moto Z2 Force  Guides, News, & Discussion] Technical:
D. Dirty flashing AOSP ROM updates

1. If you follow all the processes above, you can dirty flash updates because you have:

1.1 Motorola drivers installed.

1.2 Specific adb/fastboot files for our phone and an USB 2.0 port in a Windows computer (some users report that USB 3.0 will also work).

1.3 Unlocked bootloaders (Process A above).

1.4 Permanent TWRP running and TWRP .zip file placed inside your phone and ready to be flashed again.

1.5 An AOSP ROM already running.

1.6 Developer Options and USB debugging enabled.

1.7 If you're using TWRP older than 3.2.2-2, disable disable PIN/gestures/fingerprinting. Also, most probably, ROMs after July 20th, 2018 cannot be flashed in older TWRP.

1.8 Enough battery in your phone (80%)

2. Download your ROM .zip update, copy it into the phone sdcard and reboot your phone into TWRP. See download links here.

3. Within TWRP you should flash (install) things in the following order:

3.1 ROM update .zip file. Remember that, at this time, the update will be flashed int the other slot and inside phone you’ll have both the system before update (in the booted slot) and updated ROM in the other slot.

3.2 TWRP .zip file (step 1.4 above) once again (do not skip this step or you’ll bootloop!).

4. Reboot to System: if you skip this step, you’ll bootloop.

5. Reboot into TWRP again, flash Magisk (your settings and modules will be preserved) or LineageOS SU Addon .zip file. Note: if you bootloop on Magisk, most probably you’re flashing a wrong/different version of Magisk. I suggest v16.0 and, after you got rooted with 16.0, you can update. It is mandatory to reboot between ROM flash (step 4 above) and GApps/Addon flash due to verity/slot-swap logic.

Note: SuperSu is deprecated.

6. Wipe Dalvik/ART cache: go to Wipe menu of TWRP > Advanced Wipe > Dalvik/ART Cache only.

7. Reboot your phone into System (ROM) will use the “other” slot, the one with the updated ROM.

8. You can use XPosed installer app (and reboot).

9. Now you can add your PIN, fingerprint, gestures back until next flashing.
[Moto Z2 Force  Guides, News, & Discussion] Technical:
E. Recovering from soft bricks or returning to Stock

If you’re reading this is because you already unlock your bootloader (see guide A) and anything went wrong, but you still can boot your phone into bootloader. Plug your phone and get enough battery (even if you do not see any charging signal).

1. Install the Motorola drivers and the specific adb/fastboot files for our phone. Remember, follow the rules because our device is tricky!

1.1) Do not use other adb/fastboot binaries: we cannot guarantee they will work.

1.2) You need to use a USB 2.0 port of your computer (some users report that USB 3.0 will also work).

2. Download the latest firmware for your model:

- Retail (XT1789-05) (Europe/Brazil).

- Other models (branded): ATT, Sprint, T-Mobile (TMO), USC, Verizon.

- Note: NPXS26 versions stand for Nougat and OPXS27 for Oreo. You do not need Nougat versions for anything.

3. Extract the zip contents to a blank folder in your computer.

4. Download the FlashAll_XT1789-05.zip file (it should work for other Motorola Z2 Force models as well), extract the content and move all files to the same firmware folder (step 2 above). Be sure to overwrite any file (if needed).

5. Run the Preparation.bat file there to generate the flashfile.bat file that will send the commands to the phone. Credits: the original preparation files were from RootJunky (can be downloaded here) and include more options that we do not need for our purpose here. Also, it includes adb/fastboot binaries that could not work with our phone.

6. Reboot the phone into the bootloader (see adb command below or power + volume down). Open a command line window in the firmware folder (step 5 above), test the connection and execute the flashfile.bat file generated on step 5.

adb reboot bootloader
fastboot devices
flashfile.bat

Never ever unplug the device from the USB 2.0 port while flashing the firmware. This could cause a hard brick and your device will be dead.

7. There is a pause at the end. You should review if everything went fine (or even click on the menu of the command line window, select all and copy&paste the contents in a .txt file for further help/revision).

8. Reboot your phone into system (ROM) and do not forget, later, to enable the Developer Options and USB debugging again.

Note: if you hard brick, I suggest you be prepared to follow the Unbrick Qualcomm mobiles with Step-by-step guide or the Unbrick All Qualcomm Snapdragon’s from Qualcomm HS-USB QDLoader 9008 guide, but I never tested them myself. You can also use Qualcomm Flash Image Loader (QFIL) tool. Maybe these Latest 2017 Qualcomm Diag QD-Loader Windows 10 Drivers signed will help you.
[Moto Z2 Force  Guides, News, & Discussion] Technical:
F. Oreo ROM features comparison

This is a table for Oreo ROM features comparison for Motorola Z2 Force - nash.

I would like to receive feedback and updates from the users, as I can't keep changing from one ROM to another and they get new features, updates, improvements, etc.

I consider Lineage OS 15.1 our stock ROM regarding to customization. So, it's not listed there.

Legend:

X = Feature present
XX = ROM excels in this particular feature (in my opinion).
[Moto Z2 Force  Guides, News, & Discussion] Technical:
If you want to move your Motorola Z2 Force to Project Treble ROMs, please, check this guide.

Here is a list of the ROMs that are waiting for you.
[Moto Z2 Force  Guides, News, & Discussion] renanjones:
I came back to stock ROM. the problem is that it gets stuck in the initial configurations of the android trying to find a wifi network, to continue the configuration, without success, because I see in fastboot that the baseband is unknown, and I also can not install any rom, or recovery image because I have the following message in fastboot: FLASHING_LOCKED. and since I can not get past the initial android settings, I also can not unlock the developer options to enable OEM unlocking. now I'm standing in a rom that does not leave the initial configuration, it does not connect to any network and a fastboot that does not let me install anything. and I also tried the recovery mode and even tried to install an update via sideload, without success. I do not know what else to do if you can give me a light.
[Moto Z2 Force  Guides, News, & Discussion] Technical:
I see two possible scenarios:

1. Your bootloader is locked (yet) (see guide A).

2. Your in a "false locked" situation that, maybe, could be solved by resetting data via recovery or in bootloader (with the command: fastboot -w).
[Moto Z2 Force  Guides, News, & Discussion] Gutto:
Great tutorial, but I did not get 4g in any of the roms, only 3g
[Moto Z2 Force  Guides, News, & Discussion] Technical:
I got 4G in any ROM... AOSIP, DU or Invictrix...

Are you using a branded (carrier) phone? If not, maybe you should return to stock (to recover any changes on partitions).
[Moto Z2 Force  Guides, News, & Discussion] Gutto:
My cell phone and Sprint, I did every process that you indicated, but not 4G
[Moto Z2 Force  Guides, News, & Discussion] shalpp:
So I followed the instructions as noted, as soon as I got to the root installation part, it started throwing a "cannot mount /system" error. I thought a reboot would solve the issue, but now I think I'm bricked. Can't boot into anything, all I can do is plug my phone in and listen to it keep disconnecting every 10 seconds or so. The phone had booted up fine prior to starting the installation process, and I don't see how just a bad ROM install is preventing me from getting into either bootloader or recovery. Any advice?

For clarity, i'm unable to use QBOOT to do anything since after it hits the "powered on" state I'm assuming it's in, it just resets and does the same thing over and over again
[Moto Z2 Force  Guides, News, & Discussion] 41rw4lk:
Have you tried holding vol dwn + pwr btn to force it into bootloader mode? If you can get there, then you can use the keys to get to recovery and try a factory reset. If that don't work, go back to bootloader mode and try flashing back to stock. Might double check that the battery has plenty of charge.
[Moto Z2 Force  Guides, News, & Discussion] shalpp:
I'm unable to get the phone out of qboot (or whatever it's called). I've tried using a blank-flash but all that happens is device restarts as made evident by the "device disconnect" sound playing every few seconds. The phone had around 80% when I started the process. Should I just let it die and try loading into BL after a few hours of this thing power cycling itself?
[Moto Z2 Force  Guides, News, & Discussion] 41rw4lk:
It's weird that it is power cycling like that. Have you tired unplugging the phone and booting? Whether it's recovery, bootloader, qboot; you need to get to one place or the other if possible because power cycling won't allow you to do anything. If you can get a stable boot in any mode I would suggest moving your cable to another port so any corruptions aren't a factor anymore. I don't think a drain will resolve anything, but I've never heard anyone mention power cycling like that.
[Moto Z2 Force  Guides, News, & Discussion] shalpp:
Power cycling is just an assumption since regardless of whatever port its in it keeps an endless loop of connect, disconnect". Basically after rebooting the device after attempting to install the ROM is when it went black and started not doing anything other than connect, disconnect
[Moto Z2 Force  Guides, News, & Discussion] 41rw4lk:
When it's trying to connect do you have a pop up on your pc showing what it sees the phone as? Does it say nash fastboot, or 9008, Z2? That might give some idea of where it's failing.
[Moto Z2 Force  Guides, News, & Discussion] shalpp:
It appears as Qualcomm 9008

It only starts the loop after starting a blankflash. That's about the only response I get out of the device, otherwise it does absolutely nothing, no combination of buttons do anything

Edit: Confirmed connect/disconnect on another machine with the same driver configuration
[Moto Z2 Force  Guides, News, & Discussion] Heartblood:
I followed the guide and it worked! Got LineageOS 16 running.

BTW, as I don't have any Windows PC I did everything on Linux. I typed in every command from the flashfile.bat it worked.

Thank you!
[Moto Z2 Force  Guides, News, & Discussion] Technical:
Thanks for the feedback. Good to know all the commands work on Linux too (as they should, really).
[Moto Z2 Force  Guides, News, & Discussion] harkoliar:
reflashing back to stock worked Step E

I was able to install the stock rom in step E. I have XT1789-05 and installed the latest build in step E.

note: im in Phillippines but grey import from china, showing retcn channel. 4G however is still an issue for me when making calls. It doesnt work despite using two separate stock roms. 3G fixes it though. Could be radioband.
[Moto Z2 Force  Guides, News, & Discussion] harkoliar:
Just want to say thanks for the awesome step by step guide

easy for even a first-timer like me to flash to a stock rom. Thank you!
[Moto Z2 Force  Guides, News, & Discussion] JONASAMARAL:
the fastboot files link is broken :(
[Moto Z2 Force  Guides, News, & Discussion] JONASAMARAL:
I followed sucessfully the tutorial and managed to boot into LOS 16 but with no gapps. What's the order on flashing gapps? Should I boot to system first then go to recovery and flash gapps?
[Moto Z2 Force  Guides, News, & Discussion] Uzephi:
Flashing a rom zip on a AB device like ours flashes it to the opposing slot. After you flash rom zip, reboot recovery then flash any post zips.
[Moto Z2 Force  Guides, News, & Discussion] JONASAMARAL:
So I should format data, flash rom, reboot to recovery, flash gapps, reboot to recovery, flash Root addon?

Thanks in advance.
[Moto Z2 Force  Guides, News, & Discussion] minty95:
6. Download the FlashAll_XT1789-05.zip file, extract the content and move all files to the same firmware folder (step 5 above). Be sure to overwrite any file (if needed).

Link is dead :(
[Moto Z2 Force  Guides, News, & Discussion] Ibrajan:
Well, I have an unlocked bootloader. I am trying to flash stock orea rom as I am not receiving OTA updates.

Can't I just install the rom using update via SD card in the recovery or should I follow Method E i.e using ADB?
[Moto Z2 Force  Guides, News, & Discussion] david320te:
So, i think my Phone is "halve" dead?

fastboot getvar all
(bootloader) slot-suffi: not found
(bootloader) allt-suffixes: not found
getvar:all FAILED (remote failure)
finished. total time: -0.000s

fastboot oem fb_mode_set
(bootloader) 'fb_mode_setfixes' is not a supported oem command
(bootloader) See 'fastboot oem help'
FAILED (remote failure)
finished. total time: 0.063s

fastboot getvar max-sparse-size
(bootloader) slot-countxes: not found
(bootloader) max-sparse: not found
getvar:max-sparse-size FAILED (remote failure)
finished. total time: 0.053s

I tried going back to stock with the bat file...

getvar:max-sparse-size FAILED (remote: unknown command)
finished. total time: 0.000s
(bootloader) slot-count-size: not found
(bootloader) slot-suffi: not found
Warning: Device A/B support is outdated. Bootloader update required.
...
(bootloader) 'fb_mode_setfixes' is not a supported oem command
(bootloader) See 'fastboot oem help'
FAILED (remote failure)
finished. total time: 0.010s
(bootloader) slot-cou: not found
(bootloader) slot-suffi: not found
Warning: Device A/B support is outdated. Bootloader update required.
(bootloader) max-download-sizer: not found
target didn't report max-download-size
sending 'partition' (206 KB)...

and it hung there forever. Nothing on the phone...

Restarted the phone, came up in a "kind of" bootloop. Got out of it by pressing Vol-Down and On/Off a few seconds...started in to factory resetted stock rom. Tried getting the bootloader version over adb

nash:/ $ getprop ro.bootloader
MBM-3.0-nash_retail-cd73d31dc-180828

Can i "just" flash the bootloader first with "fastboot flash bootloader bootloader.img"? Or will i brick the phone completely...? TBH, i'm a bit at a loss right now...

TWRP is still installed though. I can boot in to TWRP and do stuff. Can i flash a custom rom? Or will i end up with a paperweight, because i can't seem to be able to install stock anymore....?
[Moto Z2 Force  Guides, News, & Discussion] Technical:
I'm lost too... Maybe it's a cable or driver issue... I never got into such fail flashings... Did you download the correct firmware for your phone?
[Moto Z2 Force  Guides, News, & Discussion] david320te:
Nope.

Now that you said it, i checked again. The one in your link for the RETAIL Version is the wrong one, for my European Retail version. I'm on Software Channel RETEU - however, i'm doubtfull it makes a difference for my flashing issues...

Maybe my bootloader is borked...it doesn't seem to recognize some commands.

Can i ignore getvar and ignore updating the partition table?
[Moto Z2 Force  Guides, News, & Discussion] Technical:
If you're flashing the correct firmware, you shouldn't ignore any command. Anything regarding partitioning is far beyond my experience...
[Moto Z2 Force  Guides, News, & Discussion] david320te:
Okay - after some really good help from Discord, i managed to find out my Computer has only ONE single USB port that works with it. After doing a bit of USB-Port switching, the getvar command finally "lit up". However, i ended up Flashing LineageOS and giving up on going stock...Motorola won't support Pie, so be it...
[Moto Z2 Force  Guides, News, & Discussion] Ruddy0580:
thanks for the guide, it helped me a lot to root I installed a custom rom
[Moto Z2 Force  Guides, News, & Discussion] JoJoEx:
. this doesn't work on my phone I'm running the Moto Z2 force on T-Mobile network but MetroPCS is my provider anytime I run the get unlock data and I am typing it correctly I'm using the newest ADB fastboot because I got it from another member when I try to unlock the bootloader or get the codes it just gives me a cursor and stays like that for a while until I basically shut it down. And a lot of the fastboot commands don't work
[Moto Z2 Force  Guides, News, & Discussion] 41rw4lk:
9x out of 10 it's either the cable, usb port, or the adb/fastboot files. Make sure you have oem unlocking enabled in dev settings, use the oem cable, 2.0 mobo port and the adb/fastboot files found around here. Check your cable, use another machine, try different ports. This phone is prissy af. Most won't encounter these problems, but as stated above one user found that only one usb was usable for fastboot commands. The cursor just sitting there would suggest that no communication is taking place. There's no big fix, it's either usb, cable, or adb/fastbbot.
[Moto Z2 Force  Guides, News, & Discussion] JoJoEx:
I'm using the OEM cable that came with the phone I'm using the USB 2.0 Port which I believe is the one that is directly connected to the motherboard I am using a laptop though. The ADB fastboot I just got off of another member and those are the newest ones... It won't even let me run getvar
[Moto Z2 Force  Guides, News, & Discussion] 41rw4lk:
I think another member used a usb hub on a laptop and got it to work, so if you have a hub plug it in and give it try. Can you run adb commands? Have you tried another cable just for the hell of it, maybe your cable is bad/defective. Maybe d/l a minimal linux distro, boot it and try running commands from there. Maybe a virtual machine with simulated 2.0 ports. My point is, some people just have trouble with ports and have to get creative. If adb/fastboot were the problem you'd probably at least get a response like failed unknown command etc. So I suspect the cable or port.
[Moto Z2 Force  Guides, News, & Discussion] JoJoEx:
You have tried three or four different cables I've tried switching all of the USB ports on the laptop I can run all the commands just fine when I run ADB or fastboot devices it shows the serial number it will allow me from ADB to reboot into bootloader. Get VAR sometimes will show me a few lines of what it's supposed to other times it will say command failed unknown and fastboot OEM get unlock just shows me a cursor
[Moto Z2 Force  Guides, News, & Discussion] 41rw4lk:
Do you have androidsdk? If so do you have the environment variables set in system? Have you tried a factory reset? (Not that I think it will solve it, but it at least it's been done and can be ruled out).

Do you have multiple adb/fastboot files stacked in folders? If possible, I would copy that adb/fastboot zip I linked you in the other post to your phone and try using it on another machine or boot some lightweight linux distro and try from there.