安装android settings 应用
首先明确一点, 下面的方法不是把Settings 应用导入Eclipse 然后编译, 而是为了方便修改一些系统应用,但不需要重新烧录文件系统的测试方法。
部分资料来自网络。
接着前面的settings项目的建立,继续讲一下setting怎么安装到真机上
–1.先按普通run android application的方式运行settings,
[2011-05-19 11:31:24 – Settings] Uploading Settings.apk onto device ‘0123456789ABCDEF’
[2011-05-19 11:31:26 – Settings] Installing Settings.apk…
[2011-05-19 11:31:29 – Settings] Re-installation failed due to different application signatures.
[2011-05-19 11:31:29 – Settings] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-05-19 11:31:29 – Settings] Please execute ‘adb uninstall com.android.settings’ in a shell.
[2011-05-19 11:31:29 – Settings] Launch canceled!
–2.安装出错,需要先卸载setting,使用adb uninstall com.android.settings,发现也失败,我这里提供一种可用的卸载方法:
adb shell “cd /system/app;rm Settings.apk;”
adb uninstall com.android.settings
这个是卸载掉了系统应用 settings
–1.先按普通run android application的方式运行settings,
[2011-05-19 11:31:24 – Settings] Uploading Settings.apk onto device ‘0123456789ABCDEF’
[2011-05-19 11:31:26 – Settings] Installing Settings.apk…
[2011-05-19 11:31:29 – Settings] Re-installation failed due to different application signatures.
[2011-05-19 11:31:29 – Settings] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-05-19 11:31:29 – Settings] Please execute ‘adb uninstall com.android.settings’ in a shell.
[2011-05-19 11:31:29 – Settings] Launch canceled!
–2.安装出错,需要先卸载setting,使用adb uninstall com.android.settings,发现也失败,我这里提供一种可用的卸载方法:
adb shell “cd /system/app;rm Settings.apk;”
adb uninstall com.android.settings
这个是卸载掉了系统应用 settings
安装apk时出现错误Failure [INSTALL_FAILED_DEXOPT]
z:\ics-android\ics-src\out\target\product\generic\system\app>adb install NativeTimer.apk
28 KB/s (10166 bytes in 0.344s)
pkg: /data/local/tmp/NativeTimer.apk
Failure [INSTALL_FAILED_DEXOPT]
原来在system\app下面的apk是经过优化的,而dex文件不会打包到apk中,dex文件会被优化后,生成odex文件。
z:\ics-android\ics-src\out\target\product\generic\system\app\NativeTimer.apk
z:\ics-android\ics-src\out\target\product\generic\system\app\NativeTimer.odex
这样安装apk时,就会缺少dex文件,导致报错[INSTALL_FAILED_DEXOPT]。
解决办法:
找到未优化过的apk,即
z:\ics-android\ics-src\out\target\product\generic\obj\APPS\NativeTimer_intermediates>adb install package.apk.unaligned
70 KB/s (138806 bytes in 1.912s)
pkg: /data/local/tmp/package.apk.unaligned
Success
安装完成后 settings 成为了用户应用。 要成为系统应用还是要你重新烧写android 系统的。