[ZenFone 2 Q&A, Help & Troubleshooting] nucleare:
Workaround Solution to the dreaded remote: flash_cmds error!

I was getting the exact same error after using xfstk-downloader_v1.7.0.exe to unbrick my Asus Zenfone 2 ZE551ML. Not seeing a reply to your post and after searching only to find unrelated posts. I took a whack at it and after a few hours, finally got my device to boot up again *insert Dr. Frankenstein's "It's Alive!" impersonation here*. My hypothesis was that it had to do with the partitioning being read incorrectly since it was the device reporting back issues with execution of the commands. In any case, here is how I got past it.

=--=-=-=-=-=-=-=-=--=--= If you want to go YOLO and skip to the answer, look for the HOT PINK

Legal Disclaimer: This is not a guide or tutorial. The following narrative may contain words or phrases commonly found in guides and tutorials found on forums.xda-developers.com such as "first," "then," and "make sure" which are used to portray the voice inside my head telling myself what to do, how to do it and what to expect and any references to taking steps as found in a guide or tutorial is purely coincidence. There are a number of important factors that could cause actual events or actual results of the typed narrative or therein to differ materially from those indicated by such set instructions.

Okay okay All kidding aside, you know the drill, im not responsible, dont hold me liable, try at your own risk and it may or may not work for you.

Updated 07-30-17: Some of the source file links were reported as broken and an alternative source was found by and provided courtesy of [MENTION=6704756]beachbouy[/MENTION] Thanks beachbouy!

||What the brick? How it all began (Skippable) ||

The following events occurred on my Zenfone 2 : ZE551ML, originally with firmware LRX21V.WW-ASUS_Z00A-2.20.40.198_20160930_8756 which I foolishly and carelessly used the built-in system update to install the recently transferred firmware update file. after unlocking the bootloader and installing custom recovery, OEM software detected and offered to update for me so i then assumed, it probably detected that it would be compatible right? so i thought, WTH why not?....lol um yea, no. failed but I was having a YOLO moment and just had to do it anyways:eek:.

Lesson learned :confused:and happy to be alive to tell someone my story ;P.

|| Road to Recover and Encountering the "FAILED (remote: flash_cmds error!" (Skippable) ||

How I ultimately arrived at receiving this error (and for you to decide whether or not it may work for you):

My device was limp bricked where the screen didn't turn on and would only vibrate after holding the power button as an indication of life when beginning with the unbrick guide as previously posted by asus_abz within this thread (or otherwise found here http://xdaforums.com/zenfone2/general/guide-brick-soft-hard-bricked-zenfone-2-t3284256)

In accordance with the guide, I was able to successfully use

xfstk-downloader

to get to the first checkpoint of success and arrived at the "not ..familiar ASUS screen but instead 4 color, just like some TV stations stop broadcasting on TV" Which means the device is working off of changes made with

droidboot_dnx.img.POS_sign.bin,

ifwi.bin,

and

dnx_fwr.bin

When attempting to use Asus FlashTool 1.0.0.14 to flash the .RAW image file, it would fail for reasons I fail to recall but otherwise...

Any attempts to use an elevated CMD prompt using the

fastboot flash boot boot.img

^^^^^^^^^would resultin the remote:flash_cmds error!:mad:

|| `';~-=Resolving The Issue: Say Goodbye to flash_cmds error!=-~;'` ||​

If you don't already have it, downlaod the .RAW format firmware for your device from the aforementioned guide at the Asus Flasher section

Otherwise ZE551ML2.20.40.194 or

ZE550ML 2.20.40.155

(direct link from guide but the one for 550 is broken)​

Open (EXTRACT) the .RAW image file with Winrar, 7zip or equivalent and extract the contants of the .RAW image file to your ADB directory

Start device in bootloader and connected with fastboot and run the following commands

fastboot oem erase_osip_header
fastboot oem start_partitioning
fastboot flash /tmp/partition.tbl partition.tbl
fastboot oem partition /tmp/partition.tbl
fastboot erase system
fastboot erase APD
fastboot erase ADF
fastboot erase cache
fastboot oem stop_partitioning
fastboot flash fastboot droidboot_sign.bin

Optionally (if you want to restore the full .RAW version)

fastboot flash ifwi ifwi.bin

Then seal the deal with

fastboot flash recovery recovery_sign.bin
fastboot format system
fastboot flash splashscreen splash_sign.bin
fastboot flash system system.img
fastboot flash boot boot_sign.bin
fastboot reboot

Alternatively, you can flash your own recovery and whatnot because by now you should be able to successfully run the flash command for those partitions, but I would suggest flashing back to full stock first and then flash to custom. Personally, I flashed everything from the .RAW firmware except for recovery

fastboot flash recovery twrp.img

After the device restarts it might go through the updating android apps screen so expect a longer than usual boot up.

Optionally, you can include "fastboot erase data" if you needed to have a clean reinstall (such as coming from a different version of android) but I didn't bother because I didn't ever successsfully load another ROM and for me, by not wiping data, I was able to have it restored back to how I had it before I made any experimenting with restoring my backup from before the shaninagans.

I hope this helps anyone who may have had the same issue. Hit the Thanks if it does!