How to take entirely android os as a image file? - android

1-I have rooted my tablet(android 5.1.1).
2-I have installed some apps as System app...
3-I need to take a backup of my entire android os, including data_user and system apps, all together.
is it possible to take an image of android os including every things?

At first, use mount or cat /proc/mtd command to identify your block devices. And then copy all image to file:
cat /dev/mtd/mtd16ro > /sdcard/my_system_image.bin
/dev/mtd/mtd16ro - system partition at my tablet (your may be different)
/sdcard/my_system_image.bin - your image at your sdcard

Related

How to use Android "Apply update from SD Card" to run custom script

I'm trying to recover some pictures from my HTC One M9. It freezes on reboot after just a few seconds. I can only access the bootloader screen (white background with colorful menu options) and the Android Recovery screen (black background with 7 options.
From that Recovery screen, I immediately see the error
E:mount /cache fail, format it and mount again
E:failed to mount /cache (Invalid Argument).. try emmc mount
I've tried Sprint phone support, the Sprint store, and HTC support.
My attempt to "Wipe Cache Partition" from that menu fails with the same error.
I've tried adb, but it doesn't recognize the device in the "List of devices attached"
I'm considering two options, both of which would require using that "update from SD card" option... either a script that copies the files to the sd card, or a script that performs the required mount. It looks like executing that update is pretty straight-forward, but I haven't found any information on how to code those functions.
The edify scripting language that's used in the updater is documented here
I don't think it will do you much good though, I'm pretty sure the update file contents have to be signed with a signature that was known to the OS when it was being compiled (either the system signature or one set as an OTA cert)

Can you clone an Android OS Image?

We have to set up a number of android devices for a project we are working on... What we have to do is actually edit the iptables of the device. Rather then doing each one by one I'm curious if there is a way to set up one device then clone the image so that we have an exact replica of that image?
We would then perhaps use PhonixCard to reinstall that image on all of the other devices...
Not sure it matters much but the device is running 4.0.1... all of the devices that we want to replicate the image on are exactly the same device.
from a previous SO answer:
Make a nandroid backup from recovery.
Make sure that the backup is located on the sdcard.
Mount the sdcard on a computer and copy it's contents to a folder on a pc.
Copy the entire contents of the folder you made above to the target device.
Root the device than install a custom recovery if you didn't do this already.
In recovery restore the nandroid backup.
Reboot the device. Now everything should be exactly the same as on the original.
Repeat steps 4-7 for every device.
If there're lots of small files that need to be transferred, another possibility is zip them up copy to the phone and than unzip it using
adb shell unzip path/to/file.zip
Once the command is launched you can disconnect the device the process will continue as long as there're no conflicting files or folders.
So answer cloning android OS images

Difference between Emulator and Real Device for Installed applications?

What is the difference for installed application's list in device and emulator. In emulator i can see the installed apps in location of /data/app
But, i can't see the installed application on my real device. Where it is stored. I can see the default application from here /system/app But i can't see installed application whatever i downloaded and my own application. Anyone guide me?
On the emulator, you have root access.
On your phone, you do not have root access (unless you root it). And each application gets its own private folder with its own linux userid, so that one application can not look into the folder of another application. This is but only one aspect of the Android security model. There are many more.
Are you looking for anything in particular in those folders? If so, there are workarounds. For instance, if you're trying to look at your sqlite.db file, one workaround is to have your own application (since it has the permission to do so) programmatically read the database file and reconstitute it on the SD card (every time you want to manually check it).
In my device (Samsung Galaxy Tab 10.1, Android 3.1) installed apps are in /data/data.
EDIT: If you want to get absolute path of your directory at runtime, you can use this trick:
getApplicationContext().getFilesDir().getAbsolutePath().replaceFirst("/file.*$", "");

How to make a simulated SD card (an image) work together with a real one in Android 2.2?

I've managed to simulate a fake sdcard on Android 2.2, so that when I don't have a real sdcard, applications that need sdcard will still work. To achieve this, I borrowed some code from the Android-x86 project's extended version of `vold', and did the following:
# dd if=/dev/zero of=/data/sdcard.img bs=1024 count=1 seek=1000000 (1GB image, a sparse file)
# busybox losetup /dev/block/loop7 /data/sdcard.img
# newfs_msdos /dev/block/loop7
The problem is, when a real sdcard is inserted, I wish to use both of them without switching back and forth between them - namely, a `dual sdcard setup' on a system which only allows one sdcard. How can this be achieved?
Personally I'm not quite familiar with the Android system (actually today is my second day working on an Android project). I was told that the 2.2 version only supports one sdcard mounted on "/mnt/sdcard", applications that read/write sdcard will follow this path. I'm not quite sure about this. Can someone please shed me some light on the Android sdcard limitations and how its presence affects applications?

Installing application on SD-card in Android sdk 2.2

I am facing this problem and finding solution for this issue since last 2 weeks.
Right now i have developed an android application for the client perpose, whose size is 54 MB, from which 52 MB of only Images/Photos.
[Edit: I need to keep images in "drawable" folder ]
So i want to install it in sd-card on Android SDK 2.2 for that i have already set android:installLocation="preferExternal" in the AndroidManifest.xml file. I have created 256MB sd-card while creating an avd , heap size - 192 , ram size - 192
but it still showing me an error:
[2010-08-27 17:58:28 - demo_test]
Failed to upload demo_test.apk on
device 'emulator-5554'
[2010-08-27
17:58:28 - demo_test]
java.io.IOException: Unable to upload
file: No space left on device
[2010-08-27 17:58:28 - demo_test]
Launch canceled!
Edit:
Is this memory related issue of internal memory or external memory?
What i have to do to run application and still test with emulator?
How do i install application in sd-card in Android sdk 2.2?
Is the sd-cards size really 256MB? I sometimes forget the suffix and end up with.. something very small.
You can also always raise the sizes to like 512, 256,266 and try again to be certain it's something else.
Also, Logcat output would be nice too.
Edit: As it seems, you cant just "install" the app on the SDcard even if you have 30+Gigabyte free on it. Installation depends also on the internal memory of the phone even in 2.2.
Example: Nexus one has 512mb internal memory. The android os takes the needed ram for the camera, gpu, kernel etc leaving a user with only around 190MB app space (which will be even lower due to apps already installed etc).
HTC Hero on the other hand has only 288mb internal memory, leaving it with a very small "app size ram".
Depending on the phone, 90mb app will install to SDcard on nexus one, but won't on Hero due to memory limitations.
The reason you are getting that error is that, after the android os takes the needed ram out of those 192MB, the "app size ram" is not enough to hold that 50+mb application.
I thought that installLocation would install directly to SD, but that is not the case.
Vidar Vestnes blog confirmed what I described above by performing a test with different app sizes on his HTC Desire..
A better approach would be to put your resources in their own directory on the SD card. Then your app can load them when it needs.
I suggest you try increasing the internal memory available (screenshot says 43MB), in case the .apk is being copied there first before it is installed to the SD card by the OS.
Assuming you need the images on your device instead of on the cloud, the easiest way would be to make the app connect to a server of yours and download a zip containing all the images on its first run. Until devices get a larger "app ram size" this might be your only solution.
You can use the following:
adb shell pm setInstallLocation 2
from the android-sdk/tools directory to force the emulator to install to your sd card, whatever its size -- preferably large enough to hold your app(s), obviously.
If you want to go back to the default installation location (phone app memory), do:
adb shell pm setInstallLocation 0
You can also use these adb commands on your phone / tablet.
Once you have set up the emulator to install to the sd card, you can then go into Settings --> Applications --> Manage Applications, choose the app you want to be on the sd card, and the "Move to SD Card" button will no longer be grayed out.
you can check if the sd card is really mounted and enough space is available by the running
adb shell df
command in the android-sdk/tools directory
it shows you which partitions are currently mounted, how big they are and how much free space is available

Categories

Resources