adbandroid

android5.1  时间:2021-02-14  阅读:()
Copyright2010SonyCorporationAndroidSystemsProgrammingTipsandTricksTimBirdSonyNetworkEntertainment,IncCopyright2010SonyCorporationOverviewIntrotoAndroidWorkingwithsourceInteractingwiththetargetTraceanddebugtoolsPerformancetoolsRandomthoughtsonAndroidResourcesCopyright2010SonyCorporationIntrotoAndroidGoogleruntimeontopofLinuxObligatoryArchitecturediagram:Copyright2010SonyCorporationAndroiddeviceproliferationCopyright2010SonyCorporationWorkingwithsourceCopyright2010SonyCorporationWorkingwithsourceGitRepoBuildsystem–Buildingfast–AddingaprogramtothebuildCopyright2010SonyCorporationGitAndroidopensourceprojectuses'git'Youneedtolearntousegitwell,…really–Needtoknowhowtodoa'gitrebase'especiallyforkernelpatches–Use'gitrebase–I'forinteractiverebaseLotsofonlineresources–Recommendedonlinebook:http://progit.
org/book/Copyright2010SonyCorporationRepo'exportREPO_TRACE=1'ishandytoseewhatgitcommandsarecalledbyrepoRepotricks–Repoforall–c'gitdiff'–Repoforall–c'echo$REPO_PATH;gitremote–v'Usetoseeupstreamremotesfromwhichtocompareandmergewith–Repomanifest–r–otag-date.
xmlMakearepositorysnapshotmanifestCopyright2010SonyCorporationBuildSystemLotsofinterestingstuffinbuild/envsetup.
sh–help–choosecombo/lunch–jgrep/cgrep–godirInteresting'make'targets:–showcommands–psuedo-targettoshowbuildcommands–sdk–canbuildtheSDKfromscratchCopyright2010SonyCorporationFastBuildingParallelmakethreads–'make–j6'Use2morethanyournumberofCPUs(includehyperthreadedCPUs)Compiledoutputcache–ccacheisin/prebuiltarea'exportUSE_CACCHE=1'Greatforrebuilds(21minutesonmydesktop)Makeonlyaspecificmodule–mm–buildonlythemodule(s)inthecurrentdirectory(andbelow)–Iusuallycombinethiswithacustominstallscript,whichcopiesfromout/target/product/Copyright2010SonyCorporationAddingaprogramtothebuildMakeadirectoryunder'external'–E.
g.
/external/myprogramCreateyourC/cppfilesCreateAndroid.
mkasacloneofexternal/ping/Android.
mk–Changethenames'ping.
c'and'ping'tomatchyourC/cppfilesandprogramnameAddthedirectorynamein/build/core/main.
mkafterexternal/zlibasexternal/myprogramMakefromtherootofthesourcetreeCopyright2010SonyCorporationInteractingwiththetargetCopyright2010SonyCorporationInteractingwiththetargetAndroidhassomeveryniceintegrationengineeringToolsdiscussed:–Fastboot–ADBUsefuldevelopmentconfigurationsCopyright2010SonyCorporationFastboot"fastboot"isbothatoolandabootloaderprotocolRequiredbyGoogleforcertifieddevicesWouldbereallynicetoadoptasanindustrystandard–e.
g.
maybesupportfastbootinU-bootFastbootoperations–Installkernel–Installnewflashimage–BootdirectlyfromhostVeryusefulfortestautomationCopyright2010SonyCorporationADBAndroidDebugBridgeToolforallkindsoftargetinteractions(install,logging,remoteshell,filecopy)–shell[]–push/pull–logcat–install/uninstallPrintthisandkeepitunderyourpillow…–http://developer.
android.
com/guide/developing/tools/adb.
htmlCopyright2010SonyCorporationADB(cont.
)Canworkovernetwork,insteadofUSB–Usefulifyourunbuildinsidevirtualmachineonhoste.
g.
IbuildonUbuntu8.
04KVMonFedora12(64-bit)host–It'ssimple:exportADBHOST=192.
168.
2.
1–Forsomereason,Ihavetokilltheserverafterrebootingthetargetadbkill-serverCalling'adb'willrespawntheserverautomaticallyCopyright2010SonyCorporationUsefuldevelopmentconfigurationsNetworkTargetHostHostUSBSerialPowercontrolNetworkTargetHostTFTPNFSKernelRootfilesystemHostUSBNetworkkernelrootfsdataflashFunctionalitytestingTargetIntegrationandPerformancetestingCopyright2010SonyCorporationTraceanddebugtoolsCopyright2010SonyCorporationTraceanddebugtoolsLogging–Kernellog(dmesg)–Logcat–StdioredirectionStraceBootchartDumpstate/dumpsysDDMSGdbCopyright2010SonyCorporationKernellogIt'sthere,usedmesgtoaccessafterbootTurnonPRINTK_TIMESfortimestampsIncreasebuffersize:CONFIG_LOG_BUF_SHIFTCanaddmessagetologfromuserspacebywritingto/dev/kmsg–VeryhandytosynchronizewithkernelmessagesCopyright2010SonyCorporationLogcatLoggingsysteminkernel–IntegratedthroughoutAndroidsystem(C+andJavaaccess)CanIncreaselogginglevelswithsetprop–Flagstocontrollogginglevelincode–(DEBUGemitsmore)Differentlogs(main,event,etc.
)–Eventlogbufferisfunky,isencodedforsize–Seejamboreepresentationonloginfohttp://blog.
kmckk.
com/archives/2936958.
html(PresentationbyTetsuyukiKobayashi)Copyright2010SonyCorporationLogcatUsefromhosttoredirecttoafileTogetmainloginfo,use:e.
g.
adblogcat–vtime–d*:V>test.
logTogetinfofrom'events'log,use-b:e.
g.
adblogcat–bevents–vtime–d|grepbootFilterusing:–CanuseANDROID_LOG_TAGSenvironmentvariable.
Iwrotemyownlogdeltatool,toseetimebetweenevents–Seehttp://elinux.
org/Improving_Android_Boot_Time#logdeltaCopyright2010SonyCorporationOverviewofAndroidLoggingSystem*ShamelessripoffofTesuyukiKobayashiCopyright2010SonyCorporationLogcatoutput(events)I/boot_progress_start(754):12559I/boot_progress_preload_start(754):17879I/boot_progress_preload_end(754):28546I/boot_progress_system_run(768):29230I/boot_progress_pms_start(768):29697I/boot_progress_pms_system_scan_start(768):30117I/boot_progress_pms_data_scan_start(768):44171I/boot_progress_pms_scan_end(768):50006I/boot_progress_pms_ready(768):50505I/boot_progress_ams_ready(768):53166I/boot_progress_enable_screen(768):56793Copyright2010SonyCorporationStdioredirectionYoucansendstdoutandstderrtothelog:RedirectingDalvikoutput:RedirectingC/cppoutput:–myprogram|xargslogAssumesyouhavebusyboxxargsinstalled#stop#setproplog.
redirect-stdiotrue#startCopyright2010SonyCorporationStraceShowssystemcallsforaprocess(orsetofprocesses)IspartofAOSPsinceeclairCanaddtoinit.
rctotraceinitialization.
–Forexample,totracezygotestartup,in/init.
rcchange:toservicezygote/system/bin/app_process-Xzygote/system/bin--zygote--start-system-serverservicezygote/system/xbin/strace-tt-o/data/boot.
strace/system/bin/app_process-Xzygote/system/bin--zygote--start-system-serverCopyright2010SonyCorporationBootchart'init'gathersdataonstartupMustre-compile'init'withsupportforbootchartdatacollectionAtoolonthehostproducesanicegraphicSeehttp://elinux.
org/Bootchartandhttp://elinux.
org/Using_Bootchart_on_AndroidCopyright2010SonyCorporationBootchartoutputCopyright2010SonyCorporationDumpstate/dumpsysDumpshugeamountsofinformationaboutthesystem,includingstatus,countsandstatisticsDumpstatereproduceslotsofstufffrom/proc–DoesadumpsysaswellDumpsysshowstatusinformationfromAndroidservices–e.
g.
dumpsysalarmFirstpartofdumphaslistofservicesyoucandumpCopyright2010SonyCorporationDDMSDalvikDebugMonitorService–http://developer.
android.
com/guide/developing/tools/ddms.
htmlLotsoffeatures,controllableviaeclipseTowatchallocationsinC/c++code,try:–Set"native=true"in~/.
android/ddms.
cfg–Usestandalongddmsprogram–Ontargetdo:#setproplibc.
debug.
malloc1#stop#startCopyright2010SonyCorporationGdbHowtoinvoke:Notethatgdbclientisafunctioninbuild/envsetup.
shFilesarestrippedinoutputdir–Unstrippedfilesareat:.
/out/target/product/generic/obj/EXECUTABLES/_intermediates/LINKED/1.
adbforwardtcp:5039tcp:50392.
adbshellgdbserver:50393.
Inanothershell,gdbclientOr,manually:$arm-eabi-gdb…#file.
/out/target/product/generic/symbols/system/bin/app_process#setsolib-search-path.
/out/target/product/generic/symbols/system/lib#targetremotelocalhost:5039Copyright2010SonyCorporationMoredebugtipsSeehttp://omappedia.
org/wiki/Android_DebuggingTonsoftips,including:–Howtodebuganativeprogramsegfault–Howtousekernelprofilerandoprofile–HowtousegdbandDDDInfoisforZoom2board,butsomethingsshouldworkonyourboardalsoCopyright2010SonyCorporationPerformancetoolsCopyright2010SonyCorporationPerformanceToolsSmemTraceview0xbenchPerfCopyright2010SonyCorporationSmemToolsforanalyzingsystem-widememoryusage–Canslice,dice,andvisualizememoryinfosnapshotRunsmemcapontarget,grabdatawithadb,thenanalyzeonhostSeehttp://elinux.
org/Using_smem_on_AndroidCopyright2010SonyCorporationTraceviewShowstraceofJavamethodsAlsoshowsprofileinformationUsercanstartandstoptracingeitherusingDDMSAppcanstartandstoptracingprogrammaticallyGoogle:"androidtraceview"Copyright2010SonyCorporation0xbenchHasseveralbuilt-inbenchmarks,suchasLinpack,Scimark2,andLibMicroProjectpageat:http://code.
google.
com/p/0xbenchIsavailableinAndroidMarketSometestsrequirerootprivilegesCopyright2010SonyCorporationPerfStandardkerneltoolforperformanceanalysisNowthatAndroidisupto2.
6.
35kernel,shouldbeabreezetouse–HavetoadmitIhaven'tdoneityet–I'mstuckon2.
6.
29AnyoneheredoneitCopyright2010SonyCorporationMiscellaneoustoolsprocranksetprop/getpropsqlite(commandline)start/stop–Canstop/startwholesystemCopyright2010SonyCorporationProcrankShowsaquicksummaryofprocesses,sortedbyVSS,RSS,PSSorUSS–Seehttp://elinux.
org/Android_Memory_UsageOutput:#procrankPIDVssRssPssUsscmdline121736848K35648K17983K13956Ksystem_server127632200K32200K14048K10116Kandroid.
process.
acore118926920K26920K9293K5500Kzygote132120328K20328K4743K2344Kandroid.
process.
media135620360K20360K4621K2148Kcom.
android.
email130320184K20184K4381K1724Kcom.
android.
settings127119888K19888K4297K1764Kcom.
android.
inputmethod.
latin133219560K19560K3993K1620Kcom.
android.
alarmclock11875068K5068K2119K1476K/system/bin/mediaserver1384436K436K248K236Kprocrank1212K212K200K200K/init753572K572K171K136K/system/bin/rild748340K340K163K152K/system/bin/sh751388K388K156K140K/system/bin/vold1215148K148K136K136K/sbin/adbd757352K352K117K92K/system/bin/dbus-daemon760404K404K104K80K/system/bin/keystore759312K312K102K88K/system/bin/installd749288K288K96K84K/system/bin/servicemanager752244K244K71K60K/system/bin/debuggerdCopyright2010SonyCorporationsetprop/getpropManyserviceshavedebugelementscontrolledbypropertiesManypropertiesaresetin/init.
rcYoucanalsoqueryandsetpropertiesonthecommandline–Use'getprop'(withnoargs)toseelistofpropertiesHavetoexaminesourceforpropertieswithspecialmeanings(orseesomethingonamailinglist)–Example:settingtheDNSserveraddressmanually:setpropnet.
nds1xx.
yy.
zz.
aaCopyright2010SonyCorporationSqliteYoucaninspectandmodifysqlitedatadirectlyfromthecommandline–Here'sanexampleofsettingthehttp_proxyforadevelopmentboardMostdatabasesareunderadirectorycalled'databases',andendin'.
db'#cd/data/data/com.
android.
providers.
settings/databases#sqlite3settings.
dbSQLiteversion3.
5.
9Enter".
help"forinstructionssqlite>insertintosystemvalues(99,'http_proxy','192.
168.
1.
1:80');sqlite>.
exit#Copyright2010SonyCorporationWrapupCopyright2010SonyCorporationRandomthoughtsonAndroidThrowsPOSIXoutthewindow–Hurray!
.
.
.
Darn.
.
.
LotsoftalkaboutAndroidfragmentation–Fragmentationdoesn'tmatterforcustomprogrammingworkIfAndroidworksforyou,thenuseit–Soon,vendorswillhavetoensurecompatibility,ratherthanappmakersSeemsdestinedtobeamajorembeddedLinuxplatform–Onlydrawback()isnon-nativeappsButeventhishasprosandconsCopyright2010SonyCorporationResourceseLinuxwikiAndroidportal:http://elinux.
org/Android_PortalUseandroid-porting,android-platform,andandroid-kernelmailinglists,dependingonwhereyourissueisSeehttp://elinux.
org/Android_Web_Resources#Mailing_ListsMye-mail:tim.
bird(at)am.
sony.
comCopyright2010SonyCorporationThanksforyourtimeQuestionsandAnswers

香港、美国、日本、韩国、新加坡、越南、泰国、加拿大、英国、德国、法国等VPS,全球独立服务器99元起步 湘南科技

全球独立服务器、站群多IP服务器、VPS(哪个国家都有),香港、美国、日本、韩国、新加坡、越南、泰国、加拿大、英国、德国、法国等等99元起步,湘南科技郴州市湘南科技有限公司官方网址:www.xiangnankeji.cn产品内容:全球独立服务器、站群多IP服务器、VPS(哪个国家都有),香港、美国、日本、韩国、新加坡、越南、泰国、加拿大、英国、德国、法国等等99元起步,湘南科技VPS价格表:独立服...

Sharktech:无限流量服务器丹佛,洛杉矶,荷兰$49/月起,1Gbps带宽哦!

鲨鱼机房(Sharktech)我们也叫它SK机房,是一家成立于2003年的老牌国外主机商,提供的产品包括独立服务器租用、VPS主机等,自营机房在美国洛杉矶、丹佛、芝加哥和荷兰阿姆斯特丹等,主打高防产品,独立服务器免费提供60Gbps/48Mpps攻击防御。机房提供1-10Gbps带宽不限流量服务器,最低丹佛/荷兰机房每月49美元起,洛杉矶机房最低59美元/月起。下面列出部分促销机型的配置信息。机房...

Asiayun:枣庄电信Asiayun美国Cera葵湾VPSvps月付,美国CERA VPS月付26元/年

亚洲云Asiayun怎么样?亚洲云成立于2021年,隶属于上海玥悠悠云计算有限公司(Yyyisp),是一家新国人IDC商家,且正规持证IDC/ISP/CDN,商家主要提供数据中心基础服务、互联网业务解决方案,及专属服务器租用、云服务器、云虚拟主机、专属服务器托管、带宽租用等产品和服务。Asiayun提供源自大陆、香港、韩国和美国等地骨干级机房优质资源,包括BGP国际多线网络,CN2点对点直连带宽以...

android5.1为你推荐
福建海峡银行股份有限公司思科route您的iphone如时间选项无法打开请更改http://www.tutorialspoint.com/css/css_dimension.htmpresent37支持ipad支持ipadIOJsios8支持ipad
重庆域名注册 香港vps 免费二级域名申请 域名备案批量查询 jsp主机 外国服务器 鲨鱼机 godaddy xfce 青果网 网通服务器ip 个人域名 赞助 卡巴斯基免费试用 卡巴斯基破解版 vip域名 台湾谷歌 国外视频网站有哪些 太原联通测速 成都主机托管 更多