Quick debugging for Android
Quick debugging for Android
Preface:At present, almost all OTT network set-top boxes on the market use the Android system. Currently, many people use a compilation server. It takes a long time to compile an Android system, when debugging a part of Android functions, You have to compile the entire Android System for debugging, which seriously reduces the work development efficiency. Coincidentally, you can see the Android debugging method written by Daniel, release and network for your reference.
The company's network set-top box (OTT) uses the chips provided by Amlogic. The following uses the amlogic Android system as an example.
1 Uboot quick debugging method 1.1 Compilation
#! /bin/bashexport PATH="/opt/amlogic/raspbian-toolchain-gcc-4.7.2-linux32/bin":$PATHexport PATH="/opt/amlogic/arm-2010q1/bin:/home/linyinghui/arm-2009q1/bin":$PATHexport PATH="/opt/amlogic/gnutools/arc2.3-p0/elf32-4.2.1/bin":$PATHexport PATH="/opt/amlogic/arc-4.8-amlogic-20130904-r2/bin":$PATH make distcleanmake m8b_m201_512M_configmake
1.2 Uboot is separately packaged into an OTA update package. Replace bootloader. img with the compiled uboot. bin to modify the script.
getprop("ro.product.device") == "m201" || abort("This package is for \"m201\" devices; this is a \"" + getprop("ro.product.device") + "\".");show_progress(0.800000, 80);set_bootloader_env("upgrade_step", "3");show_progress(0.100000, 10);write_raw_image(package_extract_file("bootloader.img"), "bootloader");set_bootloader_env("upgrade_step", "1");show_progress(0.100000, 0);
Package Signature
java -Xmx8192m -Xms1024m -jar signapk.jar -w $OTA_KEY.x509.pem $OTA_KEY.pk8 ${TMP_ZIP_PACKAGE} ${SIGN_ZIP_PACKAGE}
Quick debugging of Uboot2. Kernel upgrade using OTA update method 3. Quick debugging of Recovery
A. Compile
# Cd kitkat # source build/envsetup. sh # lunch m201-user # cd bootable/recovery # mm compiled recovery: out/target/product/m201/system/bin/recovery
B. USB flash drive debugging
Enter recovery and enter the following command to run the new recovery # busybox umount/udisk; busybox mount-t vfat/dev/block/sda1/udisk # busybox cp/udisk/recovery/sbin/recovery; # busybox sync; # busybox killall-9 recovery
After the preceding three commands are executed, the recovery will restart. After the restart, the new recovery will run.
Because the recovery uses a memory file system, the recovery is still in flash after power failure and restart.
4. Quick Framework debugging
A. Compile
#cd kitkat#source build/envsetup.sh#lunch m201_user#make framework
B. adb push
C. Restart
5. Quick debugging of Services
A. Compile
#cd kitkat#source build/envsetup.sh#lunch m201_user#make services
B. adb push
C. Restart
6. quickly switch the compilation method of User and debug Versions