Android SDK 安装方法官网原文.docx
《Android SDK 安装方法官网原文.docx》由会员分享,可在线阅读,更多相关《Android SDK 安装方法官网原文.docx(14页珍藏版)》请在冰豆网上搜索。
AndroidSDK安装方法官网原文
InstallingtheSDK
Inthisdocument
1.1.PreparingYourDevelopmentComputer
2.2.DownloadingtheSDKStarterPackage
3.3.InstallingtheADTPluginforEclipse
4.4.AddingPlatformsandOtherComponents
1.AvailableComponents
2.RecommendedComponents
5.5.ExploringtheSDK(Optional)
6.NextSteps
7.Troubleshooting
Seealso
1.ADTPluginforEclipse
2.AddingSDKComponents
ThispagedescribeshowtoinstalltheAndroidSDKandsetupyourdevelopmentenvironmentforthefirsttime.
Ifyouencounteranyproblemsduringinstallation,seetheTroubleshootingsectionatthebottomofthispage.
Updating?
IfyoualreadyhaveanAndroidSDK,usetheAndroidSDKandAVDManagertooltoinstallupdatedtoolsandnewAndroidplatformsintoyourexistingenvironment.Forinformationabouthowtodothat,seeAddingSDKComponents
Step1.PreparingYourDevelopmentComputer
BeforegettingstartedwiththeAndroidSDK,takeamomenttoconfirmthatyourdevelopmentcomputermeetstheSystemRequirements.Inparticular,youmightneedtoinstalltheJDK,ifyoudon'thaveitalready.
IfyouwillbedevelopinginEclipsewiththeAndroidDevelopmentTools(ADT)Plugin—therecommendedpathifyouarenewtoAndroid—makesurethatyouhaveasuitableversionofEclipseinstalledonyourcomputer(3.4ornewerisrecommended).IfyouneedtoinstallEclipse,youcandownloaditfromthislocation:
http:
//www.eclipse.org/downloads/
ForEclipse3.5ornewer,the"EclipseClassic"versionisrecommended.Otherwise,aJavaorRCPversionofEclipseisrecommended.
Step2.DownloadingtheSDKStarterPackage
TheSDKstarterpackageisnotafulldevelopmentenvironment—itincludesonlythecoreSDKTools,whichyoucanusetodownloadtherestoftheSDKcomponents(suchasthelatestAndroidplatform).
Ifyouhaven'talready,getthelatestversionoftheSDKstarterpackagefromtheSDKdownloadpage.
Ifyoudownloadeda.zipor.tgzpackage(insteadoftheSDKinstaller),unpackittoasafelocationonyourmachine.Bydefault,theSDKfilesareunpackedintoadirectorynamedandroid-sdk-.
IfyoudownloadedtheWindowsinstaller(.exefile),runitnowanditwillcheckwhethertheproperJavaSEDevelopmentKit(JDK)isinstalled(installingit,ifnecessary),theninstalltheSDKToolsintoadefaultlocation(whichyoucanmodify).
MakeanoteofthenameandlocationoftheSDKdirectoryonyoursystem—youwillneedtorefertotheSDKdirectorylater,whensettinguptheADTpluginandwhenusingtheSDKtoolsfromcommandline.
Step3.InstallingtheADTPluginforEclipse
AndroidoffersacustompluginfortheEclipseIDE,calledAndroidDevelopmentTools(ADT),thatisdesignedtogiveyouapowerful,integratedenvironmentinwhichtobuildAndroidapplications.ItextendsthecapabilitesofEclipsetoletyouquicklysetupnewAndroidprojects,createanapplicationUI,debugyourapplicationsusingtheAndroidSDKtools,andevenexportsigned(orunsigned)APKsinordertodistributeyourapplication.Ingeneral,developinginEclipsewithADTisahighlyrecommendedapproachandisthefastestwaytogetstartedwithAndroid.
Ifyou'dliketouseADTfordevelopingAndroidapplications,installitnow.ReadInstallingtheADTPluginforstep-by-stepinstallationinstructions,thenreturnheretocontinuethelaststepinsettingupyourAndroidSDK.
IfyouprefertoworkinadifferentIDE,youdonotneedtoinstallEclipseorADT,instead,youcandirectlyusetheSDKtoolstobuildanddebugyourapplication.ThedeveloperguidehasmoreinformationaboutDevelopinginOtherIDEs.
Step4.AddingPlatformsandOtherComponents
ThelaststepinsettingupyourSDKisusingtheAndroidSDKandAVDManager(atoolincludedintheSDKstarterpackage)todownloadessentialSDKcomponentsintoyourdevelopmentenvironment.
TheSDKusesamodularstructurethatseparatesthemajorpartsoftheSDK—Androidplatformversions,add-ons,tools,samples,anddocumentation—intoasetofseparatelyinstallablecomponents.TheSDKstarterpackage,whichyou'vealreadydownloaded,includesonlyasinglecomponent:
thelatestversionoftheSDKTools.TodevelopanAndroidapplication,youalsoneedtodownloadatleastoneAndroidplatformandtheSDKPlatform-tools(toolsthatthelatestplatformdependupon).However,downloadingadditionalcomponentsishighlyrecommended.
IfyouusedtheWindowsinstaller,whenyoucompletetheinstallationwizard,itwilllaunchtheAndroidSDKandAVDManagerwithadefaultsetofplatformsandothercomponentsselectedforyoutoinstall.SimplyclickInstalltoaccepttherecommendedsetofcomponentsandinstallthem.YoucanthenskiptoStep5,butwerecommendyoufirstreadthesectionabouttheAvailableComponentstobetterunderstandthecomponentsavailablefromtheAndroidS