[Q] busybox dd command not working when used in C# - please help - Android Q&A, Help & Troubleshooting

Right, I'm currently working on a project which involves imaging Android phones - specifically, the program I've written is mean to automate identifying the memory block containing the userdata and then using the following sequence of commands (using Android Debug Bridge) to copy it to the computer that the phone is connected to:
Code:
adb forward tcp:5555 tcp:5555
adb shell
busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number] bs=4096
This is done in command prompt and then you have to manually open another command prompt and type in:
Code:
adb forward tcp:5555 tcp:5555
nc 127.0.0.1 5555 | dd of=[chosen file name].bin bs=4096 -- progress
This copies the memory block over without any problems when done manually and even shows you in real time how much data has been transferred.
The problem I have is with automating the process in C#. Specifically, I can get every stage of it to work through using a process to write the commands to standard input and using a tcp listening port to receive the data. Apart from this crucial element of the process:
Code:
adb shell "busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number] bs=4096"
For some reason, no matter how I try to phrase it or do it, C# hates that command and won't execute it. I can manually type the exact same thing into the command prompt and it works fine but trying to do it in C# just leads to busybox acting as though I typed the command in incorrectly - this is what it gives me:
Code:
BusyBox v1.15.2 <2009-11-27 10:38:30 GMT> multi-call binary
Usage: nc [-in] [-wN] [-l] [-p Port] [-f FILENAME|PADDR PORT] [-e PROG]
Open a pipe to IP:port or file
Options:
-e PROG Run prog after connect
-i SEC Delay interval for lines sent
-w SEC Timeout for connect
-f FILE Use file <ala /dev/ttyS0> instead of network
-l Listen mode, for inbound connects
<use -l twice with -e for persistent server>
-p PORT Local port
The problem appears to be particularly with the use of bs=[bytes] but I've no idea why - and I've spent several hours searching all over the web for solutions.
So basically, I was wondering whether anyone else might have encountered this issue before and if anyone has any ideas to get around it? At the moment I'm using a script to send the commands to the command prompt but that's a kludge that I'd really prefer not to have to use.
Thanks in advance for any suggestions or comments and apologies if I've posted this in the wrong place.

Probably has to do with syntax.
In the first instance you don't have it in quotes.
Code:
busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number] bs=4096
Then you do have quotes the second time.
Code:
adb shell "busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number] bs=4096"
Sometimes, using a newer busybox helps too... 1.15.2 is kinda old

The first time is meant to show that it's being done on two different lines though I probably should have made that clearer.
Thanks for the suggestion - I just upgraded to the latest version of busybox and also altered my code so it would open cmd.exe and then run adb.exe rather than skipping straight to running adb.exe. This seems to have fixed the problem some of the time so there's probably a timing issue as well.
So I don't know whether it was the busybox version or the adb.exe/cmd.exe thing but, either way, the problem seems to have disappeared so I'm not going to change anything else in case I break it again.
Thanks very much for your help

Yep I find that there is always 2 or 3 ways to do something and usually only 1 way works all the time (lowest common denominator etc...)

@Antonine May I ask you what's the project you're talking about? I'm interested...

Related

Dump I need someone to dump boot.img

Ok im working on something big for the amaze but need someone to dump the boot.img here are the comands
1. Download ADB: http://www.mediafire.com/?5d0v316g9bg97
2. Extract the contents of the zip to C:\
3. Run the commands below:
Code:
cd c:\adb
adb shell
dd if=/dev/block/mmcblk0p22 of=/sdcard/boot.img
Note: If your device is not detected, download and install HTC Sync.
4. Connect your phone in USB Mode, copy the hboot.img file from your SD card and upload it to Multiupload.
Love to do it but I'm at work. If no one does by the time I get home ill be happy to.
Sent from my HTC_Amaze_4G using XDA App
I'll do it when I get home from school
Sent from my HTC_Amaze_4G using XDA Premium App
xboarder56 said:
Ok im working on something big for the amaze but need someone to dump the boot.img here are the comands
1. Download ADB: http://www.mediafire.com/?5d0v316g9bg97
2. Extract the contents of the zip to C:\
3. Run the commands below:
Code:
cd c:\adb
adb shell
dd if=/dev/block/mmcblk0p22 of=/sdcard/boot.img
Note: If your device is not detected, download and install HTC Sync.
4. Connect your phone in USB Mode, copy the hboot.img file from your SD card and upload it to Multiupload.
Click to expand...
Click to collapse
Didn't work. Any other ideas. This was the output.
List of devices attached
HT19RVP07371 device
C:\Users\Administrator>adb shell
$ dd if=/dev/block/mmcblk0p22 of=/sdcard/boot.img
dd if=/dev/block/mmcblk0p22 of=/sdcard/boot.img
/dev/block/mmcblk0p22: cannot open for read: Permission denied
$
Click to expand...
Click to collapse
Binary100100 said:
Didn't work. Any other ideas. This was the output.
Click to expand...
Click to collapse
maybe try this
adb pull dd if=/dev/block/mmcblk0p22 of=/sdcard/boot.img
Click to expand...
Click to collapse
xboarder56 said:
maybe try this
Click to expand...
Click to collapse
Here's the output:
C:\Users\Administrator>adb pull dd if=/dev/block/mmcblk0p22 of=/sdcard/boot.img
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
C:\Users\Administrator>
Click to expand...
Click to collapse
ohh i mean
adb pull dd if=/dev/block/mmcblk0p22
xboarder56 said:
ohh i mean
adb pull dd if=/dev/block/mmcblk0p22
Click to expand...
Click to collapse
remote object 'dd' does not exist
I tried and got the same errors...
Would it help to push busybox then try the adb pull?
EDIT: Nevermind. The reason none of this is working is because the block is only readable by root. I'm still a little too squimish to try the temp root thing, but that's the only way to get the file.
Here ya go.
HTC Amaze boot.img
Can someone return the favor an post a stock recovery image. I ruined mine and now I cannot do a factory reset or reboot into recovery.
After temp rooting the phone do this:
Code:
adb shell dd if=/dev/block/mmcblk0p23 of=/sdcard/recovery.img
Thanks,
-xdadevelopers-user
xdadevelopers-user said:
Here ya go.
HTC Amaze boot.img
Can someone return the favor an post a stock recovery image. I ruined mine and now I cannot do a factory reset or reboot into recovery.
After temp rooting the phone do this:
Code:
adb shell dd if=/dev/block/mmcblk0p23 of=/sdcard/recovery.img
Thanks,
-xdadevelopers-user
Click to expand...
Click to collapse
Will do so after phone arrives (and if i don't brick it with temp root + permanent fix). Hope you get it earlier, as that will be end of week at the earliest.
I used NVflash to originally flash Recovery on G2X - can Nvflash be used the same way here?
gaww said:
Will do so after phone arrives (and if i don't brick it with temp root + permanent fix). Hope you get it earlier, as that will be end of week at the earliest.
I used NVflash to originally flash Recovery on G2X - an Nvflash be used the same way here?
Click to expand...
Click to collapse
no its gonna have to be done through hboot

[Q] How to pipeline pipe contents from android phone via adb to my computer?

Suppose that I do the following command from windows:
Code:
adb shell cat /sdcard/myfile.zip > c:\file.zip
The result is that the two files don't match, even they have much different file size. Using 'adb pull' works but is not compatible with pipelining or fifos.
Any help?
EDITED: here is the solution:
Antonine said:
Right, I'm currently working on a project which involves imaging Android phones - specifically, the program I've written is mean to automate identifying the memory block containing the userdata and then using the following sequence of commands (using Android Debug Bridge) to copy it to the computer that the phone is connected to:
Code:
adb forward tcp:5555 tcp:5555
adb shell
busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]
This is done in command prompt and then you have to manually open another command prompt and type in:
Code:
adb forward tcp:5555 tcp:5555
nc 127.0.0.1 5555 | dd of=[chosen file name].bin -- progress
This copies the memory block over without any problems when done manually and even shows you in real time how much data has been transferred.
The problem I have is with automating the process in C#. Specifically, I can get every stage of it to work through using a process to write the commands to standard input and using a tcp listening port to receive the data. Apart from this crucial element of the process:
Code:
adb shell "busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]"
For some reason, no matter how I try to phrase it or do it, C# hates that command and won't execute it. I can manually type the exact same thing into the command prompt and it works fine but trying to do it in C# just leads to busybox acting as though I typed the command in incorrectly - this is what it gives me:
Code:
BusyBox v1.15.2 <2009-11-27 10:38:30 GMT> multi-call binary
Usage: nc [-in] [-wN] [-l] [-p Port] [-f FILENAME|PADDR PORT] [-e PROG]
Open a pipe to IP:port or file
Options:
-e PROG Run prog after connect
-i SEC Delay interval for lines sent
-w SEC Timeout for connect
-f FILE Use file <ala /dev/ttyS0> instead of network
-l Listen mode, for inbound connects
<use -l twice with -e for persistent server>
-p PORT Local port
The problem appears to be particularly with the use of bs=[bytes] but I've no idea why - and I've spent several hours searching all over the web for solutions.
So basically, I was wondering whether anyone else might have encountered this issue before and if anyone has any ideas to get around it? At the moment I'm using a script to send the commands to the command prompt but that's a kludge that I'd really prefer not to have to use.
Thanks in advance for any suggestions or comments and apologies if I've posted this in the wrong place.
Click to expand...
Click to collapse
zeppelinrox said:
Probably has to do with syntax.
In the first instance you don't have it in quotes.
Code:
busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]
Then you do have quotes the second time.
Code:
adb shell "busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]"
Sometimes, using a newer busybox helps too... 1.15.2 is kinda old
Click to expand...
Click to collapse
NOTE: you have to use unix paths with cygwin, not DOS ones. Use cygpath to convert:
Code:
cygpath -u "C:\your path\folder\archive"
Thanks man, you saved my life! I just deleted some pictures from my Nexus 7 and I had to find a way to dump the internal storage to my computer in order to use it with PhoroRec...
scandiun said:
Suppose that I do the following command from windows:
Code:
adb shell cat /sdcard/myfile.zip > c:\file.zip
The result is that the two files don't match, even they have much different file size. Using 'adb pull' works but is not compatible with pipelining or fifos.
Any help?
EDITED: here is the solution:
Click to expand...
Click to collapse
can't seem to get the -- progress part to work it kicks back error of invalid command
Code:
" adb forward tcp:5555 tcp:5555 "
" adb shell "
" su "
" busybox nc 127.0.0.1 5555 | dd of=C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img bs=4096 "
After inputting the last line I get:
: cannot open for write: Read-only file system
any Ideas? I don't understand how my pc desktop could be read only
Thanks in Advance
Phatboyj420 said:
can't seem to get the -- progress part to work it kicks back error of invalid command
Code:
" adb forward tcp:5555 tcp:5555 "
" adb shell "
" su "
" busybox nc 127.0.0.1 5555 | dd of=C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img bs=4096 "
After inputting the last line I get:
: cannot open for write: Read-only file system
any Ideas? I don't understand how my pc desktop could be read only
Thanks in Advance
Click to expand...
Click to collapse
You can't use DOS paths on cygwin, you have to use unix ones:
Code:
busybox nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img bs=4096
You can convert any DOS path to unix with cygpath if you don't figure out directly (even on other drives):
Code:
cygpath -u "C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img"
Result:
Code:
/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img
scandiun said:
You can't use DOS paths on cygwin, you have to use unix ones:
Code:
busybox nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img bs=4096
You can convert any DOS path to unix with cygpath if you don't figure out directly (even on other drives):
Code:
cygpath -u "C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img"
Result:
Code:
/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img
Click to expand...
Click to collapse
Awesome Thanks,
I'm assuming this is true in both cd & dd via cygwin?
I was originally trying to input the commands in DOS because your OP doesn't specify, or say to use cygwin.
I came to the realization of using cygwin after reading other guides.
I've been looking at some of your other guides I owe You many thanks as a Result
Phatboyj420 said:
Awesome Thanks,
I'm assuming this is true in both cd & dd via cygwin?
I was originally trying to input the commands in DOS because your OP doesn't specify, or say to use cygwin.
I came to the realization of using cygwin after reading other guides.
I've been looking at some of your other guides I owe You many thanks as a Result
Click to expand...
Click to collapse
Yes, since cygwin is to be compatible with unix scripts paths must be always in unix format.
You can use dos paths directly
Code:
cd `cygpath -u "C:\your path\folder\archive"`
I've updated the first post
scandiun said:
Yes, since cygwin is to be compatible with unix scripts paths must be always in unix format.
You can use dos paths directly
Code:
cd `cygpath -u "C:\your path\folder\archive"`
I've updated the first post
Click to expand...
Click to collapse
Awesome share Thanks
I still can't get this to work "for the life of me" I know, I now have cygwin setup right, as it works with your example here
Phatboyj420 said:
Awesome share Thanks
I still can't get this to work "for the life of me" I know, I now have cygwin setup right, as it works with your example here
Click to expand...
Click to collapse
Are you still getting "cannot open for write"?
scandiun said:
Are you still getting "cannot open for write"?
Click to expand...
Click to collapse
Nope you set me strait on that one
In the first window I do
Code:
" adb forward tcp:5555 tcp:5555 "
" adb shell "
" su "
" system/xbin/busybox nc –l –p 5555 –e dd if=/dev/block/mmcblk0 bs=4096 "
and get the usage response
Code:
BusyBox v1.22.1-Stericson (2014-01-25 17:27:18 CET) multi-call binary.
Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]
Open a pipe to IP:PORT or FILE
-l Listen mode, for inbound connects
(use -ll with -e for persistent server)
-p PORT Local port
-w SEC Connect timeout
-i SEC Delay interval for lines sent
-f FILE Use file (ala /dev/ttyS0) instead of network
-e PROG Run PROG after connect
If I trade out the string from your other example here, " The only problem i'm having with your other example is that I can't specify the " bs=4096 " "
I can get through to the second window
Example
Code:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ adb shell
[email protected]:/ $ su
su
[email protected]:/ # /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 bs=4096
555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 bs=4096 <
The second terminal then gives me an error at the last string
Output of second terminal
Code:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw bs=4096 -- progress
dd: unrecognized operand `progress'
Try `dd --help' for more information.
If I run it with out, " -- progress " it runs but with-out the desired effect of the progress response
Code:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw bs=4096
I'm at a loss I need to figure out how to run the pv and the dd of= in the same line i guess
or to some how combine
Code:
" nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw bs=4096 "
&
Code:
" nc 127.0.0.1 5555 | pv -i 0.5 > /cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw "
So as to achieve both the bs= & the Read-out notification
Thanks tremendously, for your assistance thus far.
That's right, some android implementations of dd lack advanced parameters. You can try either installing Busybox from Stericson or just skip the bs option.
Removed all the "bs=4096" from quotations in first post, since it's not needed at all.
I keep getting
write error: File too large, when trying to dump my /data partition to my external sd card.
The external card is exFat formatted, which is supposed to be able to handle larger than 4Gig files
here's my command
Code:
busybox dd if/dev/block/mmcblk0p29 of=/mnt/extSdCard/data.ext4.img
any ideas?
p.s. yes, I do have more than 4G's of software on my phone
kevp75 said:
I keep getting
write error: File too large, when trying to dump my /data partition to my external sd card.
The external card is exFat formatted, which is supposed to be able to handle larger than 4Gig files
here's my command
Code:
busybox dd if/dev/block/mmcblk0p29 of=/mnt/extSdCard/data.ext4.img
any ideas?
p.s. yes, I do have more than 4G's of software on my phone
Click to expand...
Click to collapse
Two ideas:
1 - Try from recovery
2 - If that doesn't work put the sd into a card reader and connect it as otg drive.
scandiun said:
Two ideas:
1 - Try from recovery
2 - If that doesn't work put the sd into a card reader and connect it as otg drive.
Click to expand...
Click to collapse
I can try from recovery sure, but how would #2 solve the issue? (don't know what otg drive means)
kevp75 said:
I can try from recovery sure, but how would #2 solve the issue? (don't know what otg drive means)
Click to expand...
Click to collapse
Search google images for otg
scandiun said:
Search google images for otg
Click to expand...
Click to collapse
didnt work. I get the same issue
Rockin' it from my Smartly GoldenEye 35 NF1 (muchas gracias:* @iB4STiD @loganfarrell @muniz_ri @Venom0642 @ted77usa @rebel1699* @iB4STiD) ~ 20GB free cloud https://copy.com?r=vtiraF
Check me out online @ http://kevin.pirnie.us
kevp75 said:
didnt work. I get the same issue
Click to expand...
Click to collapse
Format a pendrive in NTFS or HFS+ and connect it to your phone via OTG, if it's not detected directly there are some apps on play store.
scandiun said:
Format a pendrive in NTFS or HFS+ and connect it to your phone via OTG, if it's not detected directly there are some apps on play store.
Click to expand...
Click to collapse
NTFS worked. My data partition is over 8Gigs! But I was under the impression that exFat was able to support that... but I guess not...
kevp75 said:
NTFS worked. My data partition is over 8Gigs! But I was under the impression that exFat was able to support that... but I guess not...
Click to expand...
Click to collapse
Next time you can try copying some big data to the exfat from the computer itself, just to see if prompts some error.
scandiun said:
Next time you can try copying some big data to the exfat from the computer itself, just to see if prompts some error.
Click to expand...
Click to collapse
tried that too had a 9.7g dvd imaage i tried with and it failed at the 4g mark. ext4 should be the standard
Rockin' it from my Smartly GoldenEye 35 NF1 (muchas gracias:* @iB4STiD @loganfarrell @muniz_ri @Venom0642 @ted77usa @rebel1699* @iB4STiD) ~ 20GB free cloud https://copy.com?r=vtiraF
Check me out online @ http://kevin.pirnie.us

[GUIDE][HOWTO] How to push files using ADB Desire V

Hello guys today I am going to show you how to use a program called quick adb pusher, it is a great starting point for new android users who want to copy modified system files, without flashing update Zip’s all the time, it will also let member do things manually instead of relying on update ZIP's all the time. Besides of explaining how to use a simple program such a quick ADB Pusher, i will also explain in depth the commands of ADB through the actual command line interface, so here we go:
First of all we will start with The command line ADB, the quick adb pusher tutorial is further down the post.
Before we start explaining some of the code what is used in ADB, it is important you know what it is, it is called the Android-Debug-Bridge.
In order to even get ADB to wokr you need to follow these procedures:
Settings -> Developers options -> USB-de bugging
Then check that box, it will make you feel like a boss.
Now once you have done that your android device, is now setup for both development and ADB. Next you are going to plug your device into your computer, via a usb cable.
Once you have done that you need to go to the directory of your ADB interface, this is where you have the android SDK installed too, on a linux or mac based system this could be:
Code:
cd /home/yourusername/android-sdk-mac/tools
Once you have the ADB interface loaded into your terminal, if you type help it will show something similar to this:
Code:
Android Debug Bridge version 1.0.25
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
envivornment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
Now that you have ADB running here are some simple commands on how to use it:
How identify that your device is being recognised by ADB:
Code:
adb devices
Once this has been typed it should show something like this:
Code:
C:\Users\Daniel\Android development\ADB, Fastboot\adt-bundle-windows-x86_64\adt-
bundle-windows-x86_64\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
HT26GW507639 device
C:\Users\Daniel\Android development\ADB, Fastboot\adt-bundle-windows-x86_64\adt-
bundle-windows-x86_64\sdk\platform-tools>
If there is a line what says "HT26GW507639" with "device" at the end your devices is successfully recognised by ADB!
How to pull data from your device:
Code:
adb -s [yourdeviceADBNUMBERHERE] pull /system /the directory you want it saved too
This command will pull all the files from your devices system directory, to the directory you told it to be saved too.
I did the pull command on a PC and I was able to get all the data from following directories on my Desire C:
/data
/system
How to push data to your device:
Code:
adb -s [yourdeviceserialnumberhere] push /system/app/whatever.apk
This command will push the files you wish to your phone, though this command.
The most basic ADB commands
ADB push, as explained before this command is used to send files to your device
Code:
adb push
ADB pull, as explained before it pulls files from your phone, and makes a copy of them.
Code:
adb pull
ADB Install and example of this code would be "adb install c:\users\app.apk"
Code:
adb install c:\users\app.apk
ADB Shell, this command begins a shell connection to the device on the other end.
Code:
adb shell
ADB reboot, it does what it says
Code:
adb reboot
ADB reboot recovery, this also does what it says
Code:
adb reboot recovery
ADB reboot bootloader, this also does what is says, like the ones above.
Code:
adb reboot bootloader
ADB remount, this remounts the devices file system for editing etc...
Code:
adb remount
ADB Shell commands:
cd, this command changes directories in your devices filesystem.
Code:
cd /system/app
is, this command listes all of the file present in the directory you are at.
Code:
is /system/app
rm, this command removes file from your device.
rm /system/app/whatever.apk​cp, this command copies files, and is very similar to the cat command below.
Code:
cp /system/app/whatever.apk /sdcard/whatever.apk
cat, this command is also used to copy files to your device.
Code:
cat /system/app/whatever.apk > /sdcard/whatever.apk
exit, this command exits the ADB shell.
Code:
exit
If any of you are having any problems, read the FAQ first before posting a question in this thread, happy pushing!
If you think any other commands should me added to this section, PM me about it.
As explained above, the quick ADB pusher is an interface over the code based ADB. I will be a much easier approach for new user of android to get to grips to, that is why I am including it.
Hello guys today I am going to show you how to use a program called quick adb pusher, it is a great starting point for new android users who want to copy modified system files, without flashing update Zip’s all the time, so here we go:
First of all you want to download the quick adb pusher program, this is in both this thread and the revolution Rom thread on XDA, the link for the program is listed below:
Quick ADB Pusher​
Now you want to make sure your phone is plugged into your computer, but do not put it into USB storage mode. Make sure your USB de-bugging option is enabled it is located at:
Settings --> Developer options --> USB De-bugging​
Now you will start the quick ADB pusher program, once it has started it should detect your phone. If it does not then post a comment in the thread below and we will resolve the issue.
Watch the video below to clarify a few things, such as how to copy system apps etc...
Again I hope this tutorial helps some people out, remember to read the FAQ first before posting,, to prevent the same questions being asked time and time again.
FAQ
Do you guys want a guide on how to build roms for your device?
Sent from my HTC Desire C using xda premium
russell664 said:
Do you guys want a guide on how to build roms for your device?
Sent from my HTC Desire C using xda premium
Click to expand...
Click to collapse
Yes please I think it would be very interesting.
And thanks for your time in doing this :good:
AW: [GUIDE][HOWTO] How to push files using ADB Desire V
Me too
Sent from my HTC Desire V using xda premium
I will when I have time guys, if you want more guides and stuff, surely you can smash the thanks button right in the face for me. To show your support, and that you appreciate my work.
Creating our own custom roms
Yup. It really would be a great tutorial for newbies to get started to make things, which once they could only appreciate. I am myself good at programming and algorithms, but Android development is quite alien to me. I consider myself a potential developer, if only would I get a kick start at ROM making. Also we could be able to support unknown or local market devices. I think that would be really beneficial for the entire Android community to see new budding developers with their innovations. :angel:
Hit thanks if you agree.
russell664 said:
As explained above, the quick ADB pusher is an interface over the code based ADB. I will be a much easier approach for new user of android to get to grips to, that is why I am including it.
Hello guys today I am going to show you how to use a program called quick adb pusher, it is a great starting point for new android users who want to copy modified system files, without flashing update Zip’s all the time, so here we go:
First of all you want to download the quick adb pusher program, this is in both this thread and the revolution Rom thread on XDA, the link for the program is listed below:
Quick ADB Pusher​
Now you want to make sure your phone is plugged into your computer, but do not put it into USB storage mode. Make sure your USB de-bugging option is enabled it is located at:
Settings --> Developer options --> USB De-bugging​
Now you will start the quick ADB pusher program, once it has started it should detect your phone. If it does not then post a comment in the thread below and we will resolve the issue.
Watch the video below to clarify a few things, such as how to copy system apps etc...
Again I hope this tutorial helps some people out, remember to read the FAQ first before posting,, to prevent the same questions being asked time and time again.
Click to expand...
Click to collapse
It told me my devices wasn't rooted?
When trying to push a file to my internal storage on my Moto X does the file need to be located in a specific location? I am trying to root my device and need to push a file to my device. I am very new to this, and have adb working and my device showing up when i run "adb devices". I have a folder on my desktop titled "android" which contains adb, fastboot, sdk, and eclipse. Do I need to save the files I want to push to the root of this folder on my desktop? Thanks for the help!
stavebomb said:
When trying to push a file to my internal storage on my Moto X does the file need to be located in a specific location? I am trying to root my device and need to push a file to my device. I am very new to this, and have adb working and my device showing up when i run "adb devices". I have a folder on my desktop titled "android" which contains adb, fastboot, sdk, and eclipse. Do I need to save the files I want to push to the root of this folder on my desktop? Thanks for the help!
Click to expand...
Click to collapse
So push whole folder by
Code:
adb push <path on PC> <path on Moto X>
How to push this command
Please help me:
http://forum.xda-developers.com/showthread.php?t=2708466
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/laf
on my LG G2 (D802 ver 20B without root indian version)
My tablet is stuck in the recovery mode on a permanent loop. Please help
I'm just learning to code and honestly as of 6 months ago I didn't even know how to turn a computer on although I practice and take classes I'm petrified I'm going to screw up my computer. Anyway, my tablet is stuck in the recovery mode on a permanent loop so I can't put it in debug development mode. Please help me fix it. I can't afford a new one and I use it for work when I'm at a job site. I downloaded the Android Suite bundle zip (the one that said recommended) also the sdk tools zip, the quick adb pusher and the lollipop image file, lollipop rom file. I've tried every one of the commands from your site and many many other sites and it's not fixing my tablet. I know you guys don't like stupid questions but I'm feeling like a moron because I can't figure it out. Could someone please please help me fix me tablet.
russell664 said:
Hello guys today I am going to show you how to use a program called quick adb pusher, it is a great starting point for new android users who want to copy modified system files, without flashing update Zip’s all the time, it will also let member do things manually instead of relying on update ZIP's all the time. Besides of explaining how to use a simple program such a quick ADB Pusher, i will also explain in depth the commands of ADB through the actual command line interface, so here we go:
First of all we will start with The command line ADB, the quick adb pusher tutorial is further down the post.
Before we start explaining some of the code what is used in ADB, it is important you know what it is, it is called the Android-Debug-Bridge.
In order to even get ADB to wokr you need to follow these procedures:
Settings -> Developers options -> USB-de bugging
Then check that box, it will make you feel like a boss.
Now once you have done that your android device, is now setup for both development and ADB. Next you are going to plug your device into your computer, via a usb cable.
Once you have done that you need to go to the directory of your ADB interface, this is where you have the android SDK installed too, on a linux or mac based system this could be:
Code:
cd /home/yourusername/android-sdk-mac/tools
Once you have the ADB interface loaded into your terminal, if you type help it will show something similar to this:
Code:
Android Debug Bridge version 1.0.25
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
envivornment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
Now that you have ADB running here are some simple commands on how to use it:
How identify that your device is being recognised by ADB:
Code:
adb devices
Once this has been typed it should show something like this:
Code:
C:\Users\Daniel\Android development\ADB, Fastboot\adt-bundle-windows-x86_64\adt-
bundle-windows-x86_64\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
HT26GW507639 device
C:\Users\Daniel\Android development\ADB, Fastboot\adt-bundle-windows-x86_64\adt-
bundle-windows-x86_64\sdk\platform-tools>
If there is a line what says "HT26GW507639" with "device" at the end your devices is successfully recognised by ADB!
How to pull data from your device:
Code:
adb -s [yourdeviceADBNUMBERHERE] pull /system /the directory you want it saved too
This command will pull all the files from your devices system directory, to the directory you told it to be saved too.
I did the pull command on a PC and I was able to get all the data from following directories on my Desire C:
/data
/system
How to push data to your device:
Code:
adb -s [yourdeviceserialnumberhere] push /system/app/whatever.apk
This command will push the files you wish to your phone, though this command.
The most basic ADB commands
ADB push, as explained before this command is used to send files to your device
Code:
adb push
ADB pull, as explained before it pulls files from your phone, and makes a copy of them.
Code:
adb pull
ADB Install and example of this code would be "adb install c:\users\app.apk"
Code:
adb install c:\users\app.apk
ADB Shell, this command begins a shell connection to the device on the other end.
Code:
adb shell
ADB reboot, it does what it says
Code:
adb reboot
ADB reboot recovery, this also does what it says
Code:
adb reboot recovery
ADB reboot bootloader, this also does what is says, like the ones above.
Code:
adb reboot bootloader
ADB remount, this remounts the devices file system for editing etc...
Code:
adb remount
ADB Shell commands:
cd, this command changes directories in your devices filesystem.
Code:
cd /system/app
is, this command listes all of the file present in the directory you are at.
Code:
is /system/app
rm, this command removes file from your device.
rm /system/app/whatever.apk​cp, this command copies files, and is very similar to the cat command below.
Code:
cp /system/app/whatever.apk /sdcard/whatever.apk
cat, this command is also used to copy files to your device.
Code:
cat /system/app/whatever.apk > /sdcard/whatever.apk
exit, this command exits the ADB shell.
Code:
exit
If any of you are having any problems, read the FAQ first before posting a question in this thread, happy pushing!
If you think any other commands should me added to this section, PM me about it.
Click to expand...
Click to collapse
I Want to Thank Russell664. I followed your instructions and my tablet works again.
Thank you very much. You do not know how appreciative I am for your help. I hate feeling so stupid about these things. Your detailed guide was so informative and so so helpful. Debbie from Handyman-Girl
:good:
russell664 said:
Hello guys today I am going to show you how to use a program called quick adb pusher, it is a great starting point for new android users who want to copy modified system files, without flashing update Zip’s all the time, it will also let member do things manually instead of relying on update ZIP's all the time. Besides of explaining how to use a simple program such a quick ADB Pusher, i will also explain in depth the commands of ADB through the actual command line interface, so here we go:
First of all we will start with The command line ADB, the quick adb pusher tutorial is further down the post.
Before we start explaining some of the code what is used in ADB, it is important you know what it is, it is called the Android-Debug-Bridge.
In order to even get ADB to wokr you need to follow these procedures:
Settings -> Developers options -> USB-de bugging
Then check that box, it will make you feel like a boss.
Now once you have done that your android device, is now setup for both development and ADB. Next you are going to plug your device into your computer, via a usb cable.
Once you have done that you need to go to the directory of your ADB interface, this is where you have the android SDK installed too, on a linux or mac based system this could be:
Code:
cd /home/yourusername/android-sdk-mac/tools
Once you have the ADB interface loaded into your terminal, if you type help it will show something similar to this:
Code:
Android Debug Bridge version 1.0.25
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
envivornment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
Now that you have ADB running here are some simple commands on how to use it:
How identify that your device is being recognised by ADB:
Code:
adb devices
Once this has been typed it should show something like this:
Code:
C:\Users\Daniel\Android development\ADB, Fastboot\adt-bundle-windows-x86_64\adt-
bundle-windows-x86_64\sdk\platform-tools>adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
HT26GW507639 device
C:\Users\Daniel\Android development\ADB, Fastboot\adt-bundle-windows-x86_64\adt-
bundle-windows-x86_64\sdk\platform-tools>
If there is a line what says "HT26GW507639" with "device" at the end your devices is successfully recognised by ADB!
How to pull data from your device:
Code:
adb -s [yourdeviceADBNUMBERHERE] pull /system /the directory you want it saved too
This command will pull all the files from your devices system directory, to the directory you told it to be saved too.
I did the pull command on a PC and I was able to get all the data from following directories on my Desire C:
/data
/system
How to push data to your device:
Code:
adb -s [yourdeviceserialnumberhere] push /system/app/whatever.apk
This command will push the files you wish to your phone, though this command.
The most basic ADB commands
ADB push, as explained before this command is used to send files to your device
Code:
adb push
ADB pull, as explained before it pulls files from your phone, and makes a copy of them.
Code:
adb pull
ADB Install and example of this code would be "adb install c:\users\app.apk"
Code:
adb install c:\users\app.apk
ADB Shell, this command begins a shell connection to the device on the other end.
Code:
adb shell
ADB reboot, it does what it says
Code:
adb reboot
ADB reboot recovery, this also does what it says
Code:
adb reboot recovery
ADB reboot bootloader, this also does what is says, like the ones above.
Code:
adb reboot bootloader
ADB remount, this remounts the devices file system for editing etc...
Code:
adb remount
ADB Shell commands:
cd, this command changes directories in your devices filesystem.
Code:
cd /system/app
is, this command listes all of the file present in the directory you are at.
Code:
is /system/app
rm, this command removes file from your device.
rm /system/app/whatever.apk​cp, this command copies files, and is very similar to the cat command below.
Code:
cp /system/app/whatever.apk /sdcard/whatever.apk
cat, this command is also used to copy files to your device.
Code:
cat /system/app/whatever.apk > /sdcard/whatever.apk
exit, this command exits the ADB shell.
Code:
exit
If any of you are having any problems, read the FAQ first before posting a question in this thread, happy pushing!
If you think any other commands should me added to this section, PM me about it.
Click to expand...
Click to collapse

[Q] Make a full backup for flashing with busybox

Hello
There's a way for making a backup with RAW extension that can be flashed with fastboot in asus fonepad (i don't know about others)
See this: http://forum.xda-developers.com/showthread.php?t=1818321
Back up of the whole memory block (via adb)
Connect the phone in ADB mode and unlock the screen.
Open one Cygwin Terminal and enter (replace mmcblk0 if needed):
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
You will see the cursor blinking at the left. Now the phone is waiting to send the block over the network.
Open another Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
You will see how the image size is growing until it finishes. Now you have the whole phone backed up in raw format. You can see the contents of the GPT partition with gptfdisk tool, available for windows, linux and such. See official website and sourceforge to get it. You can do it the same from ClockWorkMod Recovery but you have to mount first the /system partition since the busybox included with clockworkmod does not come with netcat and you have to use the one from the system partition.
With further linux tools you could edit or extract single partitions from the whole block.
Click to expand...
Click to collapse
But it's for rooted devices only. how can i make a backup with busybox non-root?

Restoring From a dd Backup

I made a backup using the following guide here and now I need to restore from it. I would reply directly in the thread however I don't have permission to at the moment.
My issue is that on my phone I don't have enough space to store both a backup and the phone image and it doesn't appear that CWM can restore from a .raw file.
Is it possible to basically reverse the operation and setup this on my Mac
Code:
adb forward tcp:5555 tcp:5555
sudo nc -l -p 5555 -e dd if=/path/to/backup
and then on my phone:
Code:
adb forward tcp:5555 tcp:5555
cd /dev/block/mmcblk0
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
I get the feeling however (going with my limited understanding of Unix), this will just transfer the .raw file back and it will just possibly brick the phone. (Edit: going back and looking, maybe using …dd of=/dev/block/mmcblk0 and then using netcat to provide the file to write will work?)
I have Googled extensively and another option I have come upon is using gdisk to extract the individual partitions from the backup but this sounds fairly laborious to me.
Alternatively is it possible just to turn the .raw into tars which CWM can restore natively?
Thanks, and apologies if this is in the wrong place.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Moto G (XT1033), Cyanogenmod 11 M6

Categories

Resources