So, I have a custom AOSP image that I'm building, and it allows me to provide my own kernel and debugging features that I want (this is just for the record, because you can't do some things that are needed with a regular AVD). I need to change the contents of /vendor, and I thought that I could do this by providing my .img file to the emulator with:
emulator -vendor /path/to/my/vendor.img
But, as I checked, the md5sum does not match for some files between my vendor.img and in the /vendor/path/to/file when I run the emulator and connect with adb shell. This is perplexing to me, because when I run with -verbose, I can see the arguments given to qemu for the drive and I expect that img to be mounted under /vendor. Looking at the original vendor-qemu.img with 7z, I can check the md5sum of ome files and see that despite the -vendor argument, the sums did not change to the values in my img, but match the old intead. I even went to the length of renaming the original vendor-qemu.img and putting my img in it's place with the name vendor-qemu.img. Same result with the md5sums though.
Perhaps I could be wrong, and the -vendor emulator argument shouldn't change the contents of /vendor in the running emulator instance. What do I do to get the /vendor directory contents of a running emulator instance to match with the vendor.img?
The way I found to do it was to go to:
out/target/product/<lunch tgt>/vendor/
And just put the vendor contents the way you wish them to be. When finished do:
make vendorimage && make systemimage
Related
I'm trying to change the timestamp of the pictures I copied to my new phone from my old one. I'm using busybox's touch command through adb shell. The files names are like: IMG_20131203_223152.jpg so:
# for i in `ls IMG_*` ;
do
d=`echo $i|cut -d"_" -f2` ;
t=`echo $i|cut -d"_" -f3|cut -d"." -f1` ;
touch -t $d.$t $i ;
done
It requieres to be root in order to change the timestamp but it works, as I can see with and "ls -l". The problem is that if I go to Pictures on the phone and see the Details still show the timestamp of the moment I copied the pictures from the computer. It`s like the changes are not persisted. Ejecting and unpluging the phone from the computer doesn't work either. And I forgeting something? Thanks in advance.
EDIT: My phone hasn't external sdcard so I think is emulated using FUSE.
I found the solution. It was pretty stupid, I just have to reboot the phone.
I tried changing the screen resolution in build.prop file in system, but it requires re booting.
I need a solution for changing screen resolution on android devices without re booting.
Thanks,
Krishna
Unfortunately that is not possible. Everytime when Android boots, it will read the build.prop file and set parameters pointed by it accordingly. After it has booted, it will not access that file dynamically to change parameters. So for any change to take effect, a reboot is compulsary, you cannot escape it.
Set resolution (e.g. 1024x768):
$ am display-size 1024x768
Reset:
$ am display-size reset
Doesn't require a reboot. This works with Android 4.2. Solution for 4.3 is mentioned by LiTTle
There is also an App for that called NOMone Resolution Changer.
Android can change the screen resolution.
I think that you need Android 4.0 and above version.
Only things you need is terminal emulator and root access.
Reproduce the following steps:
1. Open the terminal emulator app.
2. Type su.
3. Type wm.
Read the help message appeared and you will understand...
In case you want an App take a look at this on Play Store or the source from Github.
I made a widget which reads an image from internal storage and displays it in an ImageView. It is working fine on the emulator (Android 2.3.3. API Level 10) but when I run it on my device (Droid Razr Android 2.3.6), it does not display the image. The widget is there on the screen but its just blank. Other parts of the widget are working fine like the Configuration Activity etc. Only the image is not appearing. What could be wrong ?
Thanks for your help!
I have two suggestions of what could be wrong:
Your file may not be where specified on your device
You may not have read permission for the file; try issuing chmod a+r yourfile in an adb shell
Okay I fixed it. In my Storage class through which I store and read images from internal memory, there is a function that takes the fileName as a parameter. Now this fileName was to be used when making the final call to store it. Instead, I had written "fileName". So there was only one file in the storage named fileName. This led to problems when reading from the storage using the actual fileName.
Free internal memory is sparse on Android 4.0, because the system occupies quite some space. This limits the number of apps one can install.
So, how can we increase the internal memory?
In the dialog for creating new AVDs, I didn't see an option for it. What did I miss? I tried some of the partition size options, but it won't affect the internal memory or the emulator hangs during boot.
greenrobot
i couldn't find that option in the UI either.
but you can start the emulator from the command line and specify the size with a parameter.
e.g.:
emulator-arm.exe -partition-size 123 -avd myandroid4
for me the path to the emulator exe is "C:\Program Files (x86)\Android\android-sdk\tools\"
replace "123" with your desired partition size and "myandroid4" with the name of your AVD
after starting my avd the free space for apps showed the desired value.
but i didn't try to write data into it.
btw you can also create a shortcut to the emulator.exe so you dont need to start the SDK Manager every time you want to start an avd.
please tell me if that worked for you.
regards
erik
I'm trying to re-partition an SDCard on Android, with root access.
I have the 512 byte MBR file, and it shows up as this:
Pos MBRndx Type/Name Size Active Hide Start Sector Sectors
--- ------ ---------- ---- ------ ---- ------------ ------------
0 0 0C-FAT32X 5.9G No No 64 12,124,096
1 1 0C-FAT32X 1.9G No No 12,124,160 3,932,160
What I'm trying to do is resize the 5.9GB partition into 3GB, and then make an EXT partition with the remaining space. I can think of two ways to do this, but I'm a bit stumped in doing either of them:
1) Cross-compile GNU parted, and run it on Android to modify the filesystem in place. This would be my preferred method, but I've been trying to statically compile parted using scratchbox and haven't had much luck, and I haven't been able to dynamically compile for Android in scratchbox either.
2) Directly modify the 512 byte MBR using some utility on my computer, and then dd the file on Android. I have a tool to view the MBR (mbrwiz), but I don't know how to edit it.
Does anybody have any suggestions for either, or possibly a third route?
Maybe I'm not seeing the problem, but it does not look like you want to automate this or make a program with that functionality. So, why not take the SD card out of the Android device and partition it in a card reader on your desktop machine? You could even do a full backup beforehand and avoid losing any data with the partitioning.
You could use fdisk instead of parted, as we used for years before the later tool came about.
Many of the android community roms include a busybox-based fdisk, which with care you could probably install without replacing the actual rom (which may not yet have a fully functional galaxy version)
Not sure how this helps the kernel changing it back problem. You could have a look in /init.rc and see if there's something you can comment out there (you would need to extract, modify, and reflash the ramdisk to make a change to that, splitting and recombining it from the kernel if they did it the same way as the htc phones)
It may also be possible to partition it with external tools when it's in usb mount mode - if the usb storage gadget just treats it as a sea of blocks, presumably you could put a partition table on it?