[转]Install App to SD

时间:2023-03-10 00:02:19
[转]Install App to SD

本文转自:http://www.douban.com/group/topic/29597344/

If you want to move more apps to the SD card, you'll need to have the Android SDK installed. How-To Install Android SDK On Windows, Mac and Linux 
Then on your phone go to settings>applications>development and enable USB Debugging. Plug your phone into the PC using the USB cable. 
open a command prompt on your PC (start>run type "cmd" press ENTER) 
Change directory to the android-sdk-windows\tools folder 
At the prompt type  Code:  adb devices  and you should see your phone listed as a serial number. 
type  Code:  adb shell pm setInstallLocation 2  Done. 
Now the default location to install apps is the SD card. And, some apps that you couldn't move to the SD card will now be able to be moved. Keep in mind Widgets and services should always be installed to the phone and not the SD card, so if you follow the steps above and you install a widget afterwards, you will need to go to settings>applications>manage applications and manually move it to the phone. If you want to set the default install location back to the phone, you simply repeat the process but use  Code:  adb shell setInstallLocation 0  Android has specific rules for where it installs apps. If the app has a specified location, that takes priority. If it is not specified in the app, then the default install location is used. Android has 3 identifiers for app storage location: 
0 = Internal  1 = Auto  2 = External (sd card) 
If 0 is set in the app, then it can only be installed on the internal storage regardless of the default install location. Widgets, services and apps that periodically poll need to be in the internal storage to run correctly. 
Similarly the phone itself can have a default install location set so if the app is set to 1 (Auto) then it will direct the app where to be installed. The only thing you must remember is that 1 is not an option for a phones default location. If the app were set to Auto location and the phone was to, it wouldn't know what the default was. 
You may find now that by setting the default install location to 2 you can now move more apps to the sd card that you couldn't before. If you go to menu>settings>applications>manage applications you can check which apps are able to be moved, paying close attention NOT to move widgets or polling apps.