Compilation automation of a single module in Android source code development

Source: Internet
Author: User
#!/bin/sh. build/envsetup.shlunch 1case $1 in        "pc")        mmm packages/apps/Contacts/        find out -name Contacts.apk |xargs -t -i adb push {} system/app/         ;;        "pp")        mmm packages/providers/ContactsProvider        find out -name ContactsProvider.apk |xargs -t -i adb push {} system/app/        ;;        "ph")        mmm packages/apps/Phone/        find out -name Phone.apk |xargs -t -i adb push {} system/app/        ;;        "pf")        mmm frameworks/base        find out -name framework.jar |xargs -t -i adb push {} system/framework/        ;;        "pm")        mmm packages/apps/Mms/        find out -name Mms.apk |xargs -t -i adb push {} system/app/        ;;        "pcrm")        find out -name Contacts.apk |xargs -t -i rm {}        mmm packages/apps/Contacts/        find out -name Contacts.apk |xargs -t -i adb push {} system/app/         ;;        "pprm")        find out -name ContactsProvider.apk |xargs -t -i rm {}        mmm packages/providers/ContactsProvider        find out -name ContactsProvider.apk |xargs -t -i adb push {} system/app/        ;;        "phrm")        find out -name Phone.apk |xargs -t -i rm {}        mmm packages/apps/Phone/        find out -name Phone.apk |xargs -t -i adb push {} system/app/        ;;        "pfrm")        find out -name framework.jar |xargs -t -i rm {}        mmm frameworks/base        find out -name framework.jar |xargs -t -i adb push {} system/framework/        ;;        "pmrm")        find out -name Mms.apk |xargs -t -i rm {}        mmm packages/apps/Mms/        find out -name Mms.apk |xargs -t -i adb push {} system/app/        ;;        "push")        adb push contacts2.db data/data/com.android.providers.contacts/databases/contacts2.db        ;;        "pull")        adb pull data/data/com.android.providers.contacts/databases/contacts2.db contacts2.db        ;;esac

Save the preceding script file as op and grant the execution permission. Use the instance "./op pc" or ",/OP pcrm" to compile the contacts module and push it to the device.

find out -name Contacts.apk |xargs -t -i rm {}

It is used to generate multiple contacts.apk in multiple lunchpattern for the sake of prevention.

xargs -t -i rm {}

-The I option tells xargs to replace {} with the name of each item {}.

The-T option indicates that xargs prints the command before executing it.

"./OP push" and "./OP pull" respectively complete the push and pull of the contacts2.db database.

PS: Firefox has an SQLite manager plug-in that can be used to conveniently view or modify the SQLite database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.