1

If I change a .mk or a .xml file in the android source code, how do I send this updated file to the device? Do I first rebuild the source tree? Or is building not necessary? After building/not-building, do I use adb push or adb sync or do I have to reflash the device?

fraiser
  • 929
  • 12
  • 28

2 Answers2

1

No you can't just push the these files as these files are merged in the img file like boot.img ,system.img etc. so you need to find out that in which img file these .xml files are added. Then you just need to make that img file like

make bootimage -j4

and flash the image to the device

In case you did't figure out then you need to rebuild the source tree.

Mushahid Gillani
  • 723
  • 7
  • 19
  • Would you know which img file to make in case of camera configuration files? – fraiser Jul 05 '18 at 13:22
  • It would lie in `$TOP/device/`. For instance, if I'm a vendor called `camera-company`, that manufactures cameras, it could be something like `$TOP/device/camera-company/setup_camera.mk` or if I were implementing my own HAL, it would be `$TOP/device/camera-company/hal/camerahal.xml` and `$TOP/device/camera-company/hal/camerahal.mk`. – fraiser Jul 05 '18 at 13:57
  • The command `make bootimage` typically only builds the image for the boot partition which contains just the kernel and ramdisk with things like init rc files. This is unlikely to actually be what the asker wants. – satur9nine Jul 13 '18 at 01:22
0

Yes building is absolutely necessary. See https://source.android.com/setup/build/building for more complete information but here are some quick notes:

If using mm or related commands you can usually follow it up with adb remount (needed just once per boot) and then: adb sync, adb shell stop, adb shell start.

If you built the entire tree via a command such as lunch aosp_xyzdevice-eng then you should probably use fastboot or other raw flashing tool provided by your SOC to flash the entire system image (and possibly boot or other images) to the device.

satur9nine
  • 13,927
  • 5
  • 80
  • 123