I want to install LineageOS so I closely followed the fastboot and adb instructions on the official site. During my first (failed) attempt, there were some old Google USB and ADB things on my PC, so I deleted everything and started again with a clean slate.
I managed to make ADB work (adb devices detects my device, could authenticate the computer, all seems good there). But if I start the phone in fastboot mode, connect and run fastboot devices, I get nothing back. It doesn't give any sign of the connected device. Windows's "Devices" window lists a device called "Android", but it's under "Unspecified" and has the yellow triangle/exclamation mark on the icon.
1. Am I right to assume that this will stop me from unlocking the bootloader (if I will use the unofficial method) and flashing TWRP and a custom ROM on the device?
2. More importantly: What could be wrong, how can I make fastboot see my phone?
Many thanks for the suggestions!
hi,
first do you have latest ADB and Fastboot
then connect your device and run adb devices. check if it detect the device means from the command prompt run "adb reboot bootloader" (without quotes)
now once after device reboots to bootloader check fastboot devices it will detect now
if not then goto device manager,right click on the device and click on update driver software and choose android fastboot interface
you are done now run fatboot devices,it will detect the device
Solved!
adbdriver com/downloads/
Related
So I am having a lot of problems with trying to root my nexus 7. I'm pretty sure it boils down to a driver issue but I'm not sure. I have tried installing the correct drivers over and over again also uninstalling other hardware manufacturers drivers and I cannot get adb to recognize my device when it is shut off and in the boot loader.
When the tablet is on and I have debugging on, adb shows up and is recognized, however my problem is that whenever I reboot into the boot loader I lose adb recognition. So therefore I can't root or do anything else. Fast boot commands work fine its only the issue with adb.
If anyone has any suggestions as to what I can do I would really appreciate it. I don't know if its just a hardware issue or something I am doing wrong on my end.
This is also not my first time manually unlocking/rooting a device
When you initially connect, the device shows up as a "Nexus 7".
When you reboot into the boot loader, the device name changes, and there is no driver for that device.
As far as I could tell, I would have to do the root process under Linux to avoid this issue.
As for me, I just ignored the issue. By the time you reboot the bootloader, you are already rooted.
The only thing you do after the reboot is rename a file. For now I am missing that step...
Yeah I'm using windows xp. When its in boot loader it does change names. I can unlock the bootloader via fastboot but can't do anything with adb. Lol I don't know what else I can do, I'm at a loss.
kevlars9 said:
Yeah I'm using windows xp. When its in boot loader it does change names. I can unlock the bootloader via fastboot but can't do anything with adb. Lol I don't know what else I can do, I'm at a loss.
Click to expand...
Click to collapse
Like I said - I think you are done...
Install a terminal on the Nexus and see what it says to "su". I use one called "terminal emulator". Works fine.
I think fastboot uses adb.
If you connect your Nexus, and type "adb devices" in a command window what does it say?
I believe it says devices attached or something like that. (Not at my computer) but doesn't give me a serial # like I think it should.
If you do not have USB Debugging checked, "adb devices" will just show the List of devices line.
If I set USB debugging on, "adb devices" also shows the Nexus serial number.
If you don't see that, I would double check the device driver you are using.
Under Device Manager, Android Phone, Android Composite ADB Interface it shows:
Driver: Google Inc.
Date: 5/24/2012
Version: 6.0.0.0
Digital Signer: google inc.
Well if I have USB debugging on and tablet on and do adb devices I get the serial # but once I go into boot loader and do adb devices I don't get the serial #.
For device manager I can choose adb interface or adb original interface. I'll have more info when I get out of work and at my computer. Do you have a link to the drivers you used? Or where to find them. Because I have tried a couple of different drivers posted around to no avail.
BTW thanks for helping me out.
I would not use any posted driver - you don't know where that thing has been.
Download the SDK from Google; the correct driver is in there.
Just point the device manager to it when you install drivers.
There are a lot of good descriptions on installing drivers in the other nexus forums
But - again - I think your device driver is fine. You will not be able to talk to the Nexus from ADB after you boot the bootloader
Bootloader has a different device name which ADB can't use under Windows.
Use Linux if you want to do that.
ok, so pretty much what happens is when my tablet is powered on with usb debugging everything is fine and ADB is recognized. Now my problem seems to be when i reboot into the bootloader it seems as though the drivers dont stick and it asks me to install the drivers again and this is where i have had all of my issues. When i type in adb devices in, it just tells me "list of devices attached" and wont let me do anything else (fastboot works). Like i said i was able to unlock my bootloader but i cant flash recovery or do anything else.
When i go into device manage to select the drivers it gives me the option of choosing between adb interface, adb bootloader interface, adb orignal interface and nexus 7 bootloader interface. I have tried all options and nothing seems to work. I have tried multiple usb cords and ports.
If anyone else has any suggestions it would be much appreciated.
I didn't read through everything but your initial problem is adb doesn't work in the bootloader that's where you use fastboot commands either boot into a custom recovery or just boot up normal and make sure debugging is checked.
Try running fastboot devices and see if it shows up. What you need to do is have bootloader unlocked and dismiss the super user zip floating around here pot that on sd card download cwm recovery image floating around boot into bootloader then
fastboot devices
fastboot flash recovery name_of_file.img
fastboot reboot bootloader
select recovery from the menu
Flash the super user zip
Or download a rom that has root and put that on sd card instead of super user zip and after doing the steps above then selecting super user zip select the rom you downloaded and flash. If you're on Linux run sudo first.
Sent from my Galaxy Nexus using xda premium
Delete
I've checked other threads but other similar threads were able to get the phone detected in Device Manager so...
I went to factory reset my old Nexus 4 after using it whilst my LG G4 was being repaired. Instead of wiping the data, I accidentally wiped the entire phone, OS included. I wasn't paying attention to what i was doing due to working at the same time and as a result the phone now only boots into TWRP and fastboot mode, but nothing else.
I tried to connect it to my windows 10 laptop so I could flash a new ROM but my laptop can't find the nexus 4 at all. Not when in recovery or when in fastboot.
Opening device manager shows that it is not there at all. There is no ACER usb device driver, nothing that resembles the nexus 4 at all. I've attached an image showing what device manager shows when the nexus 4 is connected and in recovery mode.
As you can see, there are no drivers I can uninstall. I have installed the google USB drivers from Android SDK manager. Still doesn't show. ADB doesn't work either.
I have tried multiple USB cables and every USB port. The phone charges when using an AC adaptor and charges when connected to the laptop. I can't try a different computer because I do not have access to one. Frankly I'm at a loss as to what to do.
When my nexus 4 was previously unable to connect I was able to see the device and just had to uninstall/reinstall/update drivers to get it working. This time, I can't seem to do anything. My LG G4 connects fine and without issue.
Anyone able to help?
The only way to really tell if it is a software or hardware issue would be to try another computer with Win7.
You may be able to flash a custom ROM with a OTG drive as well.
I had the same problem. When using adb and fastboot I get errors about like "error: device '(null)' not found".
Youtube video with id t0pV2pSw2N0 (sorry I am not yet allowed to post external urls) was helpfull and now I can see Android Composite ADB Interface again in the device manager. I still can not use commands adb and fastboot with exception of adb sideload. Unfortunately I have not yet succeeded to flash an image succesfully with sideload.
first try 2 remove any current drivers that are installed.
then u should experiment with different drivers.
the SkipSoft ToolKit have a huge selection, try each one of them (one of them should work).
begin with the ULTIMATE drivers and Adb/Fastboot Installer and if it don't work use the toolkit drivers.
https://skipsoft.net/download-page/
For me it turned out that MTP was enabled by default. After each restart MTP was enabled again. Now I have disabled MTP and my device is found by normal adb command.
Steps:
1) Start your device in twrp recovery mode
2) In main menu go to mount and tap "Disable MTP"
3) In main menu go to advanced -> adb sideload. Wipe caches and slide to start sideload
4) On your pc go to the command shell
5) Start "adb sideload <image_name.zip>" (replace image_name.zip with a valid image). It does not matter whether this fails or succeeds. Only thing important is that adb connects to your device.
6) Start "adb shell getprop persist.sys.usb.config". As result you will see the actual setting of the USB configuration your device when starting up. In my case it responded with "mtp,adb".
7) Start "adb shell setprop persist.sys.usb.config adb" to enable only "adb" configuration
8) Repeat step 6 to check result
9) Restart your device in recovery mode
10) Start "adb devices" to check if your device is now listed.
i_need_some_help said:
For me it turned out that MTP was enabled by default. After each restart MTP was enabled again. Now I have disabled MTP and my device is found by normal adb command.
Steps:
1) Start your device in twrp recovery mode
2) In main menu go to mount and tap "Disable MTP"
3) In main menu go to advanced -> adb sideload. Wipe caches and slide to start sideload
4) On your pc go to the command shell
5) Start "adb sideload <image_name.zip>" (replace image_name.zip with a valid image). It does not matter whether this fails or succeeds. Only thing important is that adb connects to your device.
6) Start "adb shell getprop persist.sys.usb.config". As result you will see the actual setting of the USB configuration your device when starting up. In my case it responded with "mtp,adb".
7) Start "adb shell setprop persist.sys.usb.config adb" to enable only "adb" configuration
8) Repeat step 6 to check result
9) Restart your device in recovery mode
10) Start "adb devices" to check if your device is now listed.
Click to expand...
Click to collapse
Thanks, I will give this a try!
elad.g said:
first try 2 remove any current drivers that are installed.
then u should experiment with different drivers.
the SkipSoft ToolKit have a huge selection, try each one of them (one of them should work).
begin with the ULTIMATE drivers and Adb/Fastboot Installer and if it don't work use the toolkit drivers.
https://skipsoft.net/download-page/
Click to expand...
Click to collapse
I tried removing all USB drivers and then using the toolkit and tried installing each driver. None of them allowed my PC to detect the nexus 4. As you can see in the attachment, nothing in device manager remotely resembling my nexus 4. This is after uninstalling and reinstalling and also updateing the LG G4 drivers (it makes no difference).
i_need_some_help said:
I had the same problem. When using adb and fastboot I get errors about like "error: device '(null)' not found".
Youtube video with id t0pV2pSw2N0 (sorry I am not yet allowed to post external urls) was helpfull and now I can see Android Composite ADB Interface again in the device manager. I still can not use commands adb and fastboot with exception of adb sideload. Unfortunately I have not yet succeeded to flash an image succesfully with sideload.
Click to expand...
Click to collapse
Alas, this did not work.
audit13 said:
The only way to really tell if it is a software or hardware issue would be to try another computer with Win7.
You may be able to flash a custom ROM with a OTG drive as well.
Click to expand...
Click to collapse
Unfortunately I don't have access to any other PC for this purpose. I can't connect download software or connect USB devices to the PCs at work due to security. I tried an OTG drive but TWRP wouldn't let me mount it, apparently OTG is not enabled by default for the nexus 4.
I've tried all 3 USB ports, several different cables but no luck. I guess that's it for this nexus 4 then?
If the phone is not booted into its ROM, ADB commands won't work. You need to use "fastboot devices" with the phone in bootloader mode.
You android device will reboot in several different boot modes (fastboot, recovery, normal). For each of these boot modes a separate device drive might be installed on your Windows. So check the device drive after each change of boot mode. If needed uninstall and reinstall the correct device driver.
Hey gang - this has been a bigger challenge than on any of my other devices, it's weird.
I've DLed both the TAR and IMG versions of TWRP.
Reboot to recovery, try to flash the TAR with Odin... it thinks about it for about 90 seconds and then tell me "FAILED!" Meanwhile, on the Tab screen, the little progress bar starts... but then nothing happens after that.
So I figure I'll use ADB/Fastboot to flash the IMG. So. Booted into the OS, USB Debugging on... connected to my W10 box > Command Prompt, I type "ADB devices."
[Hex code for Tab] - unauthorized
I unplug / replug and get the popup "Authorize USB debugging?" on the Tab. [OK]
ADB devices gives me [hex] - device
Fastboot devices doesn't show anything.
OK. ADB reboot recovery
Now in recovery mode.
ADB devices... -> nothing
Fastboot devices... -> nothing
Why does it show up in teh OS but not in recovery? And why does ADB work but not Fastboot in the OS?
Maddening. Help?
Quick follow-up. Got it installed.
I tried a different computer, and downloaded Odin 3.12 to that vs. 3.10 on my main computer. Not sure which of these changes was responsible but I was able to flash TWRP without issue.
I have a brand new Oneplus 8 Pro from China with global ROM installed.
I wanted to unlock the bootloader however there is no fastboot option in the boot menu.
There is Start, Restart Bootloader, Recovery and Turn Off.
The Fastboot option is missing.
I can connect the phone to my PC, adb recognizes the phone, but Fastboot is missing.
Any ideas?
Docomoco said:
I have a brand new Oneplus 8 Pro from China with global ROM installed.
I wanted to unlock the bootloader however there is no fastboot option in the boot menu.
There is Start, Restart Bootloader, Recovery and Turn Off.
The Fastboot option is missing.
I can connect the phone to my PC, adb recognizes the phone, but Fastboot is missing.
Any ideas?
Click to expand...
Click to collapse
Sure. You are allready in that mode. Just type fastboot devices and check..
I did that but no response.
The cursor jumps to the next line but there is no response from the phone.
If I type adb devices the phone is listed but the fastboot command doesn't return anything.
Docomoco said:
I have a brand new Oneplus 8 Pro from China with global ROM installed.
I wanted to unlock the bootloader however there is no fastboot option in the boot menu.
There is Start, Restart Bootloader, Recovery and Turn Off.
The Fastboot option is missing.
I can connect the phone to my PC, adb recognizes the phone, but Fastboot is missing.
Any ideas?
Click to expand...
Click to collapse
Restart to bootloader, then fastboot should work. If your phone is still on, and you can access adb, you should also be able to type adb reboot bootloader
Thanks.
So apparently the command "fastboot devices" returns nothing.
However I was able to unlock the bootloader just by entering "adb reboot bootloader" then
"fastboot oem unlock".
What confused me was that there is no "fastboot" option on the phone itself as there was on my Oneplus 5t.
Docomoco said:
Thanks.
So apparently the command "fastboot devices" returns nothing.
However I was able to unlock the bootloader just by entering "adb reboot bootloader" then
"fastboot oem unlock".
What confused me was that there is no "fastboot" option on the phone itself as there was on my Oneplus 5t.
Click to expand...
Click to collapse
The option in the power menu is called bootloader (fastboot only will work there) the hint was in the adb command I gave you, adb reboot BOOTLOADER. Not sure why they changed what the menu was called but I'm glad you got it sorted. To give you a short summary, adb will only work when your phone is powered on and booted into android, or if you have recovery mode open and on the adb section, and fastboot only works in the bootloader hope that could help!
Edit: fastboot devices should work but only in bootloader mode, not when your phone is started normally
Docomoco said:
I have a brand new Oneplus 8 Pro from China with global ROM installed.
I wanted to unlock the bootloader however there is no fastboot option in the boot menu.
There is Start, Restart Bootloader, Recovery and Turn Off.
The Fastboot option is missing.
I can connect the phone to my PC, adb recognizes the phone, but Fastboot is missing.
Any ideas?
Click to expand...
Click to collapse
You have to insert a SIM card, boot of the device and make a phone call to get it to register your device. Wait a few minutes and then restart your phone. Go into settings under about phone and enable developer options. Back out and go into developer options and you will see OEM unlock. You need to turn that on and USB debugging. Both of them must be turned on. Now you can boot into fastboot and unlock your bootloader. It will wipe the device so if you have any data you want to save you better do it now.
hey i am having this issue, i am able to adb reboot bootloader but when i try to oem unlock or anything else, it is just waiting for device and not finding it....
SourPower said:
hey i am having this issue, i am able to adb reboot bootloader but when i try to oem unlock or anything else, it is just waiting for device and not finding it....
Click to expand...
Click to collapse
That's a driver issue.
Are you using Windows 7? If so use 10
If not then sort out your driver's and it'll be fine.
Theres a bug in 7 where the driver for ADB cannot be collaborated with fastboot drivers.
dladz said:
That's a driver issue.
Are you using Windows 7? If so use 10
If not then sort out your driver's and it'll be fine.
Theres a bug in 7 where the driver for ADB cannot be collaborated with fastboot drivers.
Click to expand...
Click to collapse
thanks for the reply, i am on windows 10 and i dont know what is causing the issue when the phone goes in fastboot, but i went on my wife's laptop and got it working within a few minutes after installing adb...
Having similar problem here:
win10x64, drivers installed, USB debugging is enabled.
ADB sees the devices, reboots it correctly with "adb reboot bootloader"
then bootloader menu's shown:
START // RESTART BOOTLOADER // RECOVERY MODE // SHOW BARCODE // POWER OFF
Fastboot mode
Product_name - kona
Variant - SM8 UFS
BOOTLOADER VERSION - (nothing appears here)
BASEBAND VERSION - (nothing appears here)
Serial number - (appears 8-symbol sn)
SECURE BOOT - YES
DEVICE STATE - LOCKED
trying to communicate with smartphone via terminal "fastboot" command doesn't do much:"fastboot devices" doesn't return anything at all, "fastboot oem unlock" just shows <waiting for device>
tried to reinstall drivers
tema_ka said:
Having similar problem here:
win10x64, drivers installed, USB debugging is enabled.
ADB sees the devices, reboots it correctly with "adb reboot bootloader"
then bootloader menu's shown:
START // RESTART BOOTLOADER // RECOVERY MODE // SHOW BARCODE // POWER OFF
Fastboot mode
Product_name - kona
Variant - SM8 UFS
BOOTLOADER VERSION - (nothing appears here)
BASEBAND VERSION - (nothing appears here)
Serial number - (appears 8-symbol sn)
SECURE BOOT - YES
DEVICE STATE - LOCKED
trying to communicate with smartphone via terminal "fastboot" command doesn't do much:"fastboot devices" doesn't return anything at all, "fastboot oem unlock" just shows <waiting for device>
tried to reinstall drivers
Click to expand...
Click to collapse
If you type fastboot reboot what happens? If nothing then either you're device doesn't have usb debugging on, could be the cable/usb slot (some people have had issues with this)
Or its the driver installed for fastboot.
Show hidden devices in device manager you may have multiple devices, remove them all and start over.
Your also need to have used ADB and have trusted the device (prompt will appear on your phone the first time you connect it successfully whilst in your phones system, not fastboot)
for windows 10:
firstly download the google adb driver:
Get the Google USB Driver | Android Studio | Android Developers
The Google USB Driver is required to perform adb debugging on Windows with Google devices.
developer.android.com
then do the following:
1. adb devices [you should see your device ] > adb reboot bootloader
2. device manager > update driver > chose from list [android device]
3. still in device manager got the newly populated Android device and then update driver > choose adb interface
3. fastboot oem unlock
etc.
hope this helps
i have similar problem
then bootloader menu's shown:
START // RESTART BOOTLOADER // RECOVERY MODE // SHOW BARCODE // POWER OFF
Fastboot mode
Product_name - kona
Variant - SM8 UFS
BOOTLOADER VERSION - (nothing appears here)
BASEBAND VERSION - (nothing appears here)
Serial number - (appears 8-symbol sn)
SECURE BOOT - YES
DEVICE STATE - LOCKED
i reached till fastboot. fastboot oem unlock is not working because SECURE BOOT - Yes.
any help will be highly appreciated
shweta007 said:
i have similar problem
then bootloader menu's shown:
START // RESTART BOOTLOADER // RECOVERY MODE // SHOW BARCODE // POWER OFF
Fastboot mode
Product_name - kona
Variant - SM8 UFS
BOOTLOADER VERSION - (nothing appears here)
BASEBAND VERSION - (nothing appears here)
Serial number - (appears 8-symbol sn)
SECURE BOOT - YES
DEVICE STATE - LOCKED
i reached till fastboot. fastboot oem unlock is not working because SECURE BOOT - Yes.
any help will be highly appreciated
Click to expand...
Click to collapse
Secure Boot means your Bootloader is locked.
Setup fastboot correctly, open a cmd window, navigate to fastboot.exe and enter fastboot oem unlock, follow instructions on phone screen
So, my HTC U Ultra got stuck in bootloop just 3 days after warranty ended(tough luck level : 100).
My phone runs on everything stock and no root.
I press all the buttons when powered off and it goes into bootloader mode. It displays options to boot into recovery mode, boot into download mode and power down, all of which(except power down) gets device into bootloop again.
THE PRIORITY OF GOALS IS : DATA RECOVERY > PHONE BOOTING AND WORKING PROPERLY AGAIN
I did a little research and figured out some sort of procedure by putting bits and pieces together :
1. Download ADB/Fastboot toolkit || universal driver from koush github // I have HTC Sync manager installed as well || twrp custom recovery image for htc u ultra || new ruu from htc support for rom update.
2. Now I put my phone into fastboot mode (since it doesn't show up on adb devices), connect to pc using usb.
3. I type in cmd : "fastboot devices" --> My device shows up there --> Again in cmd : "fastboot boot recovery mytwrp.img" --> the twrp boots into my phone
I was able to put this many steps together and after the last step, i have an abstract idea of what to do :
Enable USB Debugging using twrp recovery --> Use ADB Pull Command to get my all my data from phone to pc --> Use adb wipe the old Firmware (Not sure which command) --> Use adb again to flash new RUU (again not sure how, I've got an .exe file as RUU || should I get it in zip or img or any other format ? || Please help on this too) --> Finally Boot and hopefully everything turns out smooth and secure.
CAN YOU EXPERTS HELP ME TO PUT TOGETHER REMAINING STEPS (AND MODIFY ERRORS, IF ANY, OF EXISTING STEPS ) OF THIS PROCEDURE...???
Only to clarify: ADB and Fastboot are 2 completely different things.
ADB
is a protocol that allows you to communicate with an Android device that got booted, means its main Android OS is running
At Windows command prompt you enter commands - one by one -
Code:
adb devices
adb <ANY_SUPPORTED_ADB_SUBCOMMAND>
FASTBOOT
is a program used to manipulate (list, install, erase) the non-volatile memory such as flash filesystem partitions on devices that adhere to the fastboot protocol, via a USB connection from a host computer. It requires that the device be started in a boot loader mode with the fastboot protocol enabled.
IMPORTANT: Fastboot will only work if the OEM/Carrier has included support for the Fastboot protocol.
At Windows command prompt you enter commands - one by one -
Code:
adb devices
adb reboot bootloader
fastboot devices
fastboot <ANY_SUPPORTED_FASTBOOT_SUBCOMMAND>
jwoegerbauer said:
Only to clarify: ADB and Fastboot are 2 completely different things.
ADB
is a protocol that allows you to communicate with an Android device that got booted, means its main Android OS is running
At Windows command prompt you enter commands - one by one -
Code:
adb devices
adb <ANY_SUPPORTED_ADB_SUBCOMMAND>
FASTBOOT
is a program used to manipulate (list, install, erase) the non-volatile memory such as flash filesystem partitions on devices that adhere to the fastboot protocol, via a USB connection from a host computer. It requires that the device be started in a boot loader mode with the fastboot protocol enabled.
IMPORTANT: Fastboot will only work if the OEM/Carrier has included support for the Fastboot protocol.
At Windows command prompt you enter commands - one by one -
Code:
adb devices
adb reboot bootloader
fastboot devices
fastboot <ANY_SUPPORTED_FASTBOOT_SUBCOMMAND>
Click to expand...
Click to collapse
@jwoegerbauer Yes, thank you for the description, I understood the difference later on. Do you think the fastboot and adb steps I've mentioned will work properly ?
noobie12112 said:
@jwoegerbauer Yes, thank you for the description, I understood the difference later on. Do you think the fastboot and adb steps I've mentioned will work properly in my case?
Click to expand...
Click to collapse
Android boot loop error does not come out of thin air. There are several cases that may cause the Android is starting loop. If phone didn't get physically damaged then an action of the user is the main reason .
To answer your question: NO.
As already said:
ADB is integral part of Android OS hence if Android OS isn't started you can't make use of ADB, Fastboot is integral part of phone's bootloader ( comparable to a Windows PC's UEFI/BIOS ) means you can't access Android OS - will say its folders and files.
jwoegerbauer said:
Android boot loop error does not come out of thin air. There are several cases that may cause the Android is starting loop. If phone didn't get physically damaged then an action of the user is the main reason .
To answer your question: NO.
As already said:
ADB is integral part of Android OS hence if Android OS isn't started you can't make use of ADB, Fastboot is integral part of phone's bootloader ( comparable to a Windows PC's UEFI/BIOS ) means you can't access Android OS - will say its folders and files.
Click to expand...
Click to collapse
@jwoegerbauer Thank you for the insight. In my case, the phone wasn't physically damaged, the bootloop occurred out of the blue one day. Now, what I presumed I should do, is to flash a custom recovery (twrp) using "fastboot boot recovery.img" command, and using twrp (Can I enable USB Debugging using twrp ?) to access files, backup and then flash a new RUU. But I found that I need to unlock bootloader, is there any way to use command "fastboot oem unlock" and not lose data, or any other method to unlock bootloader, where i don't lose data?
Thank you for your help.
Unlocking phone's bootloader always causes complete loss of data.
Forget the TWRP thing, it's not helpful at all in your case.
Try to flash phone's Stock ROM by means of ADB - what requires ADB got installed on Windows computer and USB debugging got ( manually !!! ) enabled on phone.