虚拟机ubuntu 使用adb 编译调试系统app Settings.apk



虚拟机ubuntu 使用adb




VMware® Workstation 12 Player
12.1.1 build-3770994


No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise


VMware设置:
player->可移动设备 与主机断开连接 即连接到虚拟机


用lsusb命令查询usb设备id
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc. 
Bus 001 Device 026: ID 0bda:0139 Realtek Semiconductor Corp. 
Bus 001 Device 035: ID 1f3a:1007 
                       VID :PID
cd root/
cd .android/


cat adb_usb.ini 
0x1f3a
没有adb_usb.ini就vi一个,在里面填入
android 设备的VID 0x1f3a就可以了






直接编译settings系统应用,无需编译、烧录整个系统包,
提升工作效率
我的是全志A33平台




在源码的根目录下创建 setting_mk.sh
其内容为以下:




. build/envsetup.sh 
lunch 5
#根据自己的实际情况确定,不要瞎搞


echo $pwd
cmd="mmm  packages/apps/Settings/  -j8" 
$cmd
adb remount 


echo out = $OUT
adb push $OUT/system/priv-app/Settings.apk /system/priv-app/ 
adb reboot






mmm frameworks/base/services/input
mmm frameworks/base/services/jni
mmm frameworks/base/policy -j8 

mmm frameworks/base/services/java   -j8


adb push $OUT/system/lib/libinputservice.so  /system/lib/libinputservice.so
adb push $OUT/system/lib/libandroid_servers.so  /system/lib/libandroid_servers.so
adb push $OUT/system/framework/android.policy.jar /system/framework/android.policy.jar
adb push $OUT/system/framework/services.jar  /system/framework/services.jar 
adb shell /system/bin/killpid.sh




#the killpid.sh in android target board /system/bin/
#Its content is-->
#echo kill hello
#kill -9 $(busybox pidof system_server)


#adb reboot

reboot之后 usb要重连,而

adb shell /system/bin/killpid.sh adb usb无需重连。 
 

你可能感兴趣的:(虚拟机ubuntu 使用adb 编译调试系统app Settings.apk)