Does someone know how to flash Xperia phones on Linux? - Sony Xperia XZ Premium Questions & Answers

I really think Windows 10 sucks, I've been having serious problems installing the drivers for the XZ P, and I was reading newflasher tool was designed for multiplatform including Linux but haven't found any information explaining how to install and use newflasher on Linux, can someone please help me with this information and if possible it will include the flasher tool for the Xperia XZ (F8331), thank you.

Hello bro
The Newflasher was provided precompile binary on its thread,just download it and decompress, use it like before.
If u wanna use Flashtool, u need to install Oracle JRE or OpenJDK as your like, then download Linux version by the link below
For XperiaFirm, u need to install the MONO environment by ur PackageManager first. Please refer to its thread.
I hope this can help you.
links:
Newflasher: https://forum.xda-developers.com/crossdevice-dev/sony/progress-newflasher-xperia-command-line-t3619426
Flashtool http://www.flashtool.net/downloads_linux.php
Xperifirm https://forum.xda-developers.com/crossdevice-dev/sony/pc-xperifirm-xperia-firmware-downloader-t2834142/

Precompiled binary didn't for me on Mint 19.3, so I had compile myself from source.
Window 10 indeed sucks, I switched to linux like 2 years ago and never looked back.
I recommend looking forward for basic terminal command and how to compile apps from source. It's not that difficult as it sounds.
For example check newflasher github, it provides building instructions
https://github.com/newflasher/newflasher/blob/master/readme.md
Easy version: download zip from github, unpack it.
Open terminal in that folder and type
make newflasher.x64 (if I guessed your architecture)
You will get a new binary "newflasher.x64"
Then you will need to drop it in folder with unpacked firmware and run "./newflasher.x64", if you get an error, try with sudo.
If you are lucky, you won't need compilation

Related

[upload] fastboot and adb binaries for 64-bit linux

i've just compiled android, and have adb and fastboot which may be of use for you! i couldn't find anywhere to actually download fastboot (the links on the htc site are dead), so i thought i'd put them up here for you.
they were compiled on 64-bit debian, but should work on any 64-bit linux platform. heck, as i had to install a lot of 32-bit headers, they may even work on a 32-bit machine. i can't test, so let me know if they do, and i'll update this post.
MarkusPO said:
i've just compiled android, and have adb and fastboot which may be of use for you! i couldn't find anywhere to actually download fastboot (the links on the htc site are dead), so i thought i'd put them up here for you.
they were compiled on 64-bit debian, but should work on any 64-bit linux platform. heck, as i had to install a lot of 32-bit headers, they may even work on a 32-bit machine. i can't test, so let me know if they do, and i'll update this post.
Click to expand...
Click to collapse
bash-4.1$ file adb
adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
I am usually on 64bit gentoo, but by netbook runs a 32bit gentoo.
You could give me the source and I'll try to compile it as 32bit for the others.
I would like to obtain the source anyway.
Thanks, man
Thanks a lot @MarkusPO. I had a bricked LG P500 phone after clockworkmod installation failure as it only booted in fastboot mode. So, your fastboot binary was instrumental to flash the recovery image again and get my phone back without restoring oficial LG ROM. It worked in Ubuntu 10.04 32-bits with SDK installed.
file fastboot
fastboot: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, BuildID[sha1]=0xe3aff04e690e0f530f8fe8f00b1845d50f39b203, not stripped
They are both 32bit binaries
Sorry for doing some necromancy on an old discussion, but when I was looking for fastboot and adb Debian 64bit binaries, this particular thread kept coming back.
The information needs however some update that could be useful for the next soul ending up here in the hope of finding these software without having to go through the trouble of installing the SDK and executing binaries without knowing where they are coming from!
There are official Debian packages for adb and fastboot and you can use your favourite package manager to install them.
At the time of this post, they are only available on Sid, which I use, but you should be able to download the *.deb below and install them without trouble on Wheezy (Squeeze might require more work).
http://packages.debian.org/sid/android-tools-adb
http://packages.debian.org/sid/android-tools-fastboot
Hope that helps!
Thank you so much for this, was looking for this forever
Huge thankk
Cheers mate,
I've been looking for a way to flash recovery image from ubuntu, for a whole month. You've done a marvelous job, thank you so much!
C
MarkusPO said:
i've just compiled android, and have adb and fastboot which may be of use for you! i couldn't find anywhere to actually download fastboot (the links on the htc site are dead), so i thought i'd put them up here for you.
they were compiled on 64-bit debian, but should work on any 64-bit linux platform. heck, as i had to install a lot of 32-bit headers, they may even work on a 32-bit machine. i can't test, so let me know if they do, and i'll update this post.
Click to expand...
Click to collapse
Not 64-bit
MarkusPO said:
i've just compiled android, and have adb and fastboot which may be of use for you! i couldn't find anywhere to actually download fastboot (the links on the htc site are dead), so i thought i'd put them up here for you.
they were compiled on 64-bit debian, but should work on any 64-bit linux platform. heck, as i had to install a lot of 32-bit headers, they may even work on a 32-bit machine. i can't test, so let me know if they do, and i'll update this post.
Click to expand...
Click to collapse
I found this thread looking for a 64-bit ADB binary, and..
That's a 32-bit binary.
It's not even statically linked, so it can't be used on a 64-bit machine without first installing a ton of 32-bit dependencies.
All those 32-bit headers you had to install were installed because you were making a 32-bit binary.
Code:
$ file adb
adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped
$ objdump -x adb | grep NEEDED
NEEDED librt.so.1
NEEDED libncurses.so.5
NEEDED libpthread.so.0
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
NEEDED libdl.so.2
That means that on a 64-bit system, you'd have to install the 32-bit versions of librt, libncurses, libpthread, libstdc++, libm, libgcc_s, libc, and libdl.
This binary has no connection to the x86_64 architecture whatsoever, and ran flawlessly on an i686 Linux live CD.

How to download the latest ADB/Fastboot binaries without the sdk?

I want to download the latest possible ADB/Fastboot binaries because a little bird whispered in my ear that the Asus USB ID's have been added so -i 0x0b05 isn't needed when using fastboot on the TF201.
Anyways, I do NOT use the "android-sdk" nor have I ever downloaded it. I simply used a tool called knives and forks which put the binaries in system32/syswow64 and then somehow symlinked them to always respond when typing "adb" in CMD regardless of where i start the CMD. I don't need to cd to an android-sdk folder (I don't even have one, derp)
So how can I update to the latest binaries WITHOUT downloading the sdk?
removed
shabbypenguin said:
while not the most ideal answer, i work on a lot of low end devices and in an effort to keep it simple for em i bundle up the binaries needed for most devices. normally i have adb for all 3 platforms and fastboot for all three. ive yet to update the mac and linux binaries but my zip does have the latest windows adb/fastboot
www.Shabbypenguin.com/OUDstuff/Tools/ADB-Tools.zip
Click to expand...
Click to collapse
Much obliged!
Thank you! You just saved me from a 2-3hr download tethered to my phone!
shabbypenguin said:
while not the most ideal answer, i work on a lot of low end devices and in an effort to keep it simple for em i bundle up the binaries needed for most devices. normally i have adb for all 3 platforms and fastboot for all three. ive yet to update the mac and linux binaries but my zip does have the latest windows adb/fastboot
www.Shabbypenguin.com/OUDstuff/Tools/ADB-Tools.zip
Click to expand...
Click to collapse
I've been frustrated with error: device offline.
My SDK manager is still downloading stuff & I found this thread.
Latest adb helps!!!
Thank you so much.
dsymbol said:
I've been frustrated with error: device offline.
My SDK manager is still downloading stuff & I found this thread.
Latest adb helps!!!
Thank you so much.
Click to expand...
Click to collapse
that zip is old, instead http://androidforums.com/faqs/443072-adb-guide-updated-2013-05-21-a.html#post5389081
use teh attached file there. chances are the device offline is due to outdated adb and a 4.2 device.
shabbypenguin said:
that zip is old, instead http://androidforums.com/faqs/443072-adb-guide-updated-2013-05-21-a.html#post5389081
use teh attached file there. chances are the device offline is due to outdated adb and a 4.2 device.
Click to expand...
Click to collapse
you're absolutely correct.
i've updated to 4.3 & run into device offline problem.
Your adb 1.0.31 helps. in less than 5 mins, while i've been sitting here for 3 hours waiting for the SDK manager to update files.
Thanks for this!

[TOOL] Heimdall 1.4 RC1

Hi everybody!
You might have already seen the flagship Galaxy devices (S, S2, S3) getting support for various new tools. One of these is Heimdall. It is an Open-Source Cross-Platform Flashing Suite originally meant to run on the Galaxy S, but thanks to its popularity, the S2, S3 and other devices also got the support. Literally speaking, it is the Linux and OS X alternative of Odin (It supports Windows as well.). (Read more about Heimdall here.)
Since our device is a variant to the SGS2, the download mode protocol of the two devices are the same. This enables us to use this tool with our device so we don't have to stick with Windows if we want to reflash a stock rom or install a recovery via download mode.
I have compiled the latest version (1.4 RC1) for Linux if you want to try it out. I'm running a 64-bit Ubuntu 12.10. The tool might work on other distributions, but not on 32-bit systems! (There are precompiled 32-bit versions on the website of the author.)
So what do you need to get it running?
Download my precompiled binary (http://www.mediafire.com/?85nny8d1mpea5hp) and extract it somewhere. Then install libusb-1.0 which is a prerequisite of running the tool. Finally, give the Heimdall executable execute rights and make sure you run it as root.
First steps to do for making it sure that the tool works and communicates with your device:
Put your device into download mode by holding down Volume down, Home and Power keys.
Connect your USB cable.
Execute: 'heimdall detect' (This will show if the phone cannot be detected.)
Execute: 'heimdall download-pit --output SGR.pit' (This will download the PIT (Partition Information Table) file of the device.)
Execute: 'heimdall print-pit --file SGR.pit' (This will give you detailed information about the partition structure of the device and this information can be used to identify partitions which you will flash to.)
The three most important information shown by the PIT file are 'Identifier', 'Partition Name' and 'Flash Filename'. For example if you want to flash a recovery image, you will look for 'recovery.img' as 'Flash Filename'. You can find that the corresponding 'Identifier' is '14' and 'Partition Name' is 'SOS' for our device. You can flash your recovery.img with one of the following commands:
Code:
heimdall flash --[COLOR="Red"]SOS[/COLOR] /path/to/recovery.img
Code:
heimdall flash --[COLOR="Red"]14[/COLOR] /path/to/recovery.img
Notice the 'Partition Name' and 'Identifier' values highlighted in red.
This was just an example scenario. You can flash full factory images, repartition the device, change the bootloader, or dump a whole partition. There are many opportunities. If you are interested in using this tool, don't neglect taking time for reading about it first as it can seriously brick your device (Even though APX mode gives an enormous help in recovering the device.). I don't recommend that you use this tool for those not having much experience in what they do. However, this tool can help a lot if you use Linux and don't want to reboot to/use Windows if you want to return to a stock rom.
Every custom modification to devices have risks. Use this at your own risk!
Have fun and enjoy!
wow... you are great buddy!!!!
Sent from my GT-I9103 using xda app-developers app
Are the pre-compiled 32-bit versions compatible with our device? If not, can u compile a 32-bit version for our device?
Thnx!
The-Droidster said:
Are the pre-compiled 32-bit versions compatible with our device? If not, can u compile a 32-bit version for our device?
Thnx!
Click to expand...
Click to collapse
It should be. The website says that 1.3.2 has some issues with certain devices, it also recommends 1.3.1.
Sent from my GT-I9103
trying to install heimdall on my macbook air 64bit os 10.7.5 but getting this error 'heimdal frontend cannot be opened because of a problem check with the developer to make sure heimdall-frontend works with this version of macos.'
and for boot.img its --LNX
Envoyé depuis mon GT-I9103
Thanks
Envoyé depuis mon GT-I8190
Adam77Root said:
Hi everybody!
You might have already seen the flagship Galaxy devices (S, S2, S3) getting support for various new tools. One of these is Heimdall. It is an Open-Source Cross-Platform Flashing Suite originally meant to run on the Galaxy S, but thanks to its popularity, the S2, S3 and other devices also got the support. Literally speaking, it is the Linux and OS X alternative of Odin (It supports Windows as well.). (Read more about Heimdall here.)
Since our device is a variant to the SGS2, the download mode protocol of the two devices are the same. This enables us to use this tool with our device so we don't have to stick with Windows if we want to reflash a stock rom or install a recovery via download mode.
I have compiled the latest version (1.4 RC1) for Linux if you want to try it out. I'm running a 64-bit Ubuntu 12.10. The tool might work on other distributions, but not on 32-bit systems! (There are precompiled 32-bit versions on the website of the author.)
So what do you need to get it running?
Download my precompiled binary (http://www.mediafire.com/?85nny8d1mpea5hp) and extract it somewhere. Then install libusb-1.0 which is a prerequisite of running the tool. Finally, give the Heimdall executable execute rights and make sure you run it as root.
First steps to do for making it sure that the tool works and communicates with your device:
Put your device into download mode by holding down Volume down, Home and Power keys.
Connect your USB cable.
Execute: 'heimdall detect' (This will show if the phone cannot be detected.)
Execute: 'heimdall download-pit --output SGR.pit' (This will download the PIT (Partition Information Table) file of the device.)
Execute: 'heimdall print-pit --file SGR.pit' (This will give you detailed information about the partition structure of the device and this information can be used to identify partitions which you will flash to.)
The three most important information shown by the PIT file are 'Identifier', 'Partition Name' and 'Flash Filename'. For example if you want to flash a recovery image, you will look for 'recovery.img' as 'Flash Filename'. You can find that the corresponding 'Identifier' is '14' and 'Partition Name' is 'SOS' for our device. You can flash your recovery.img with one of the following commands:
Code:
heimdall flash --[COLOR="Red"]SOS[/COLOR] /path/to/recovery.img
Code:
heimdall flash --[COLOR="Red"]14[/COLOR] /path/to/recovery.img
Notice the 'Partition Name' and 'Identifier' values highlighted in red.
This was just an example scenario. You can flash full factory images, repartition the device, change the bootloader, or dump a whole partition. There are many opportunities. If you are interested in using this tool, don't neglect taking time for reading about it first as it can seriously brick your device (Even though APX mode gives an enormous help in recovering the device.). I don't recommend that you use this tool for those not having much experience in what they do. However, this tool can help a lot if you use Linux and don't want to reboot to/use Windows if you want to return to a stock rom.
Every custom modification to devices have risks. Use this at your own risk!
Have fun and enjoy!
Click to expand...
Click to collapse
Hello and thank you.
I always get:
libusb error: 0
When downloading or printing.
any Ideas, please?
Fintanusa said:
Hello and thank you.
I always get:
libusb error: 0
When downloading or printing.
any Ideas, please?
Click to expand...
Click to collapse
Did you run it as root?
Sent from my OmniROM-powered LG Optimus 4X HD
Adam77Root said:
Did you run it as root?
Sent from my OmniROM-powered LG Optimus 4X HD
Click to expand...
Click to collapse
I will try that in the morning. Thank you.
Fintanusa said:
I will try that in the morning. Thank you.
Click to expand...
Click to collapse
Ok. Did that. revieved this error:
~$ sudo heimdall-frontend
[sudo] password for fintan3:
Error: "/var/tmp/kdecache-fintan3" is owned by uid 1000 instead of uid 0.
"/org/freedesktop/UDisks2/drives/SAMSUNG_HM320HJ_S2AUJDBB501625" : property "Drive" does not exist
"/org/freedesktop/UDisks2/drives/hp______DVD_RAM_UJ8B1_SKB2426348" : property "Drive" does not exist
"/org/freedesktop/UDisks2/drives/SAMSUNG_HM320HJ_S2AUJDBB501625" : property "DeviceNumber" does not exist
"/org/freedesktop/UDisks2/drives/SAMSUNG_HM320HJ_S2AUJDBB501625" : property "Device" does not exist
Error: "/tmp/ksocket-fintan3" is owned by uid 1000 instead of uid 0.
Error: "/tmp/kde-fintan3" is owned by uid 1000 instead of uid 0.
Click to expand...
Click to collapse
Got my .pit file though. Thnaks. I think I will dig a bit deeper before flashing anything. Cheers
I do not know how to execute it at all. What am I supposed to do? Do I just go into terminal and type sudo heimdall-frontend? That does not do anything. I extracted the executable, but I have no idea as how to run it. I have Linux Mint Petra 16 Cinnamon.
Adam77Root said:
Hi everybody!
You might have already seen the flagship Galaxy devices (S, S2, S3) getting support for various new tools. One of these is Heimdall.
----
Every custom modification to devices have risks. Use this at your own risk!
Have fun and enjoy!
Click to expand...
Click to collapse
Hey, any new pre compiled version available to share? Thanks! :good:

[Completed] How to run Linux on android

Hello,There is some ways where you can Linux system on android ,
1.you have to download 'complete Linux installer' ,Terminal Emulator for android' and last one which is ' android vnc'.
2.Open Complete Linux installer ,It'll install boot scripts which are needed . Off course you need rooted android phone for this.
3.You will see Linux distros which are available for your device e.g. Debian,Ubuntu, Kali Linux etc.
4.Then click on any one and it will show to download these distrisos and further procedures.
Thank You Reeding..download all things from playstor
sanket73 said:
Hello,There is some ways where you can Linux system on android ,
1.you have to download 'complete Linux installer' ,Terminal Emulator for android' and last one which is ' android vnc'.
2.Open Complete Linux installer ,It'll install boot scripts which are needed . Off course you need rooted android phone for this.
3.You will see Linux distros which are available for your device e.g. Debian,Ubuntu, Kali Linux etc.
4.Then click on any one and it will show to download these distrisos and further procedures.
Thank You Reeding..download all things from playstor
Click to expand...
Click to collapse
Hello,
This forum is for newbies finding their way around XDA Developers, it isn't a development section.
Please post here Android Software Development Forum, the users looking for the same could use your help.
Thread closed !
-Vatsal

Debian/Ubuntu/Mint Linux and Moto X4

Personally, after Windows 8, followed by Windows 10, I started to seriously look into Linux (which is free) as my primary desktop. Today LibreOffice (which is free) has more features than Microsoft Office and can open, edit, and save all of Microsoft Office's documents. Thanks to Steam's new deployment, I can even now run my Windows-only games on Linux too. The one thing I found very hard to swallow was trying to get my Andriod device (which is technically Unix too) to actually connect to my computer and I imagine that is because the documentation (even via a Google search) to using ADB or Fast Boot with Linux seems to be hidden among pages upon pages of Windows users.
For simple ease of reference as I couldn't even find this here on XDA, allow me to correct the matter.
Type out (or copy and paste) the following commands to install ADB and Fastboot.
Code:
sudo apt-get install adb
sudo apt-get install fastboot
Now you have both adb and fastboot installed. Next, you'll need to enable adb.
Code:
sudo adb
Now boot your phone to your bootloader screen (you get there by pressing both your power and lower volume keys at the same time). Once there load TWRP with the following command.
Code:
sudo fastboot boot '/your_path_here/twrp-3.2.3-0-payton.img'
Your path will be wherever you happen to have downloaded your copy of TWRP. From there I was able to successfully mount my device within TWRP and upload my ROM zip file as needed.
You will upload files to your phone using the "ADB PUSH" command to your /sdcard/ directory (as admin in windows or root in Linux). For example:
Code:
adb push lineage-16.0-20180921-UNOFFICIAL-payton.zip /sdcard/
I hope this was helpful.
Note: Because you're doing this in Linux, the files you upload to your phone may not have the correct permission settings (chmod settings) after they are uploaded. This is very unlikely, but still technically possible.
Thankfully, the folks at TWRP have thought of this and in the 'Advanced' menu, you will find a file manager. From there select the file of your choice and click the chmod button that reads "chmod 0777". Don't forget to mount the DATA partition (before using the file manager) else you may not see the file you are looking for.
or just download the package from here
https://developer.android.com/studio/releases/platform-tools
unzip and have fun
munchy_cool said:
or just download the package from here
https://developer.android.com/studio/releases/platform-tools
unzip and have fun
Click to expand...
Click to collapse
This is helpful, but most newbies to Linux wouldn't even know how to execute those base files. lol But Windows users coming to Linux do know how to run command prompts (good old Microsoft kept the command prompt around long enough that folks moving to Linux just associate the terminal in the same light). Which is why I thought to have them install a preconfigured program would be easier.
But thanks for the source. It is still useful.
MotoX4 said:
This is helpful, but most newbies to Linux wouldn't even know how to execute those base files. lol But Windows users coming to Linux do know how to run command prompts (good old Microsoft kept the command prompt around long enough that folks moving to Linux just associate the terminal in the same light). Which is why I thought to have them install a preconfigured program would be easier.
But thanks for the source. It is still useful.
Click to expand...
Click to collapse
lol..i thought the first thing a Linux newbie would learn is command prompt.
you need to read about terminal before you decide using a Linux box.
munchy_cool said:
lol.. I thought the first thing a Linux newbie would learn is the command prompt.
you need to read about terminal before you decide using a Linux box.
Click to expand...
Click to collapse
:laugh: I agree. But there are a lot of folks who feel intimidated whenever learning something new. If I had started this thread with a full introduction to manually configuring and executing everything, most folks would have easily been discouraged. Especially the younger or older generations who fall somewhere between the line of "I don't got time for that" or "why so difficult". lol :laugh: Inoculating folks into using Linux I feel works best. Keep it simple and suggest that there are more in-depth ways of doing things to peak curiosity. -- Which is why I'm glad you pointed that out and why I'm loving writing this reply at the moment. :angel:

Categories

Resources