Install apk into the system partition via ADB

Source: Internet
Author: User
Tags chmod

Install apk into the system partition via ADB

Take Google Pinyin as an example:
googlepinyin1.4.2.apk
Extract the so file
Libjni_googlepinyinime_4.so
Libjni_googlepinyinime_latinime_4.so


The contents of the bat batch script are as follows:
Path "D:\Program files\ perfect brush machine \tools";%path%


Prompt $G
cd/d "%1"
Cls


ADB devices


adb shell su-c "Mount-o remount Rw/system"


Set apk=googlepinyin1.4.2.apk
ADB push%apk%/data/local/tmp/
adb shell su-c "cat/data/local/tmp/%apk% >/system/app/%apk%"
adb shell su-c "Chown 0.0/system/app/%apk%"
adb shell su-c "chmod 644/system/app/%apk%"


Set lib=libjni_googlepinyinime_4.so
ADB push%lib%/data/local/tmp/
adb shell su-c "cat/data/local/tmp/%lib% >/system/lib/%lib%"
adb shell su-c "Chown 0.0/system/lib/%lib%"
adb shell su-c "chmod 644/system/lib/%lib%"


Set lib=libjni_googlepinyinime_latinime_4.so
ADB push%lib%/data/local/tmp/
adb shell su-c "cat/data/local/tmp/%lib% >/system/lib/%lib%"
adb shell su-c "Chown 0.0/system/lib/%lib%"
adb shell su-c "chmod 644/system/lib/%lib%"


adb shell su-c "Mount-o remount Rw/system"
Pause


ADB reboot


If the APK software is very large, you need to use the batch installation script, the content is as follows
Path "D:\Program files\ perfect brush machine \tools";%path%


Prompt $G
cd/d "%1"
Cls
@echo Current directory: CD =%cd%
@echo Current File: file=%file%
@echo.
ADB wait-for-device
ADB devices


adb shell su-c "Mount-o remount Rw/system"


for/f "delims="%%i in (' dir/b/a-d/S *.apk ') do (
echo Push%%~nxi To/system/app
Set Apk=%%~nxi
ADB push%%~nxi/data/local/tmp/
adb shell su-c "Cat/data/local/tmp/%%~nxi >/system/app/%%~nxi"
adb shell su-c "Chown 0.0/system/app/%%~nxi"
adb shell su-c "chmod 644/system/app/%%~nxi"
adb shell su-c "Rm/data/local/tmp/%%~nxi"
)


for/f "delims="%%j in (' dir/b/a-d/S *.so ') do (
echo Push%%~NXJ To/system/lib
Set LIB=%%~NXJ
ADB push%%~nxj/data/local/tmp/
adb shell su-c "CAT/DATA/LOCAL/TMP/%%~NXJ >/system/lib/%%~nxj"
adb shell su-c "Chown 0.0/system/lib/%%~nxj"
adb shell su-c "chmod 644/system/lib/%%~nxj"
adb shell su-c "RM/DATA/LOCAL/TMP/%%~NXJ"
)


adb shell su-c "Mount-o remount Rw/system"


Pause
ADB reboot


This script also supports, drag the APK folder to the above automatic installation.

Install apk into the system partition via ADB

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.