[Tech News][feat1]

Wednesday, March 26, 2014

Push APK files using ADB

Here's what you need to know to start on this adventure:
Knowledge of: Android SDK, command prompt, adb push (command), adb pull (command), setting permissions in adb shell (chmod), apktool (compiling/decompiling), 7zip, Notepad++ or equivalent.

Pushing the file to our phone
Here I am taking SystemUI.apk as an example.
Plug in your phone to your computer.
Open command prompt, and change directories to your Android SDK - platform-tools directory (mine is at: C:\sdk\platform-tools).
Type: adb reboot recovery
On your phone, mount /system. If you don't, you won't be able to access/make changes to /system.
Type: adb shell
Type: cd /system/app
Type: mv SystemUI.apk SystemUI.bak
NOTE: This copies your existing phone's SystemUI.apk to a file named SystemUI.bak. We are backing up our file, I HIGHLY RECOMMEND THIS.
Type: exit
Type: adb push SystemUI.apk /system/app/
Type: adb shell
Type: chmod 0644 /system/app/SystemUI.apk
Type: exit

Now, reboot your phone normally.


Now, if you screwed up and you need to revert back to your original SystemUI.apk before we pushed the new one, here's how:

Type: adb reboot recovery
On your phone, mount /system.
Type: adb shell
Type: cd /system/app/
Type: rm SystemUI.apk
NOTE: This deletes your newly pushed SystemUI.apk file.
Type: mv SystemUI.bak SystemUI.apk
Type: exit

Reboot your phone normally. Notice we did not do the permissions chmod command again. Why not? We don't have to since copying the file retains its permissions. We only need to do this when pushing a new file to the system


Downloads- Android SDK
                   

No comments:

Post a Comment