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

hostyun评测香港原生IPVPS

hostyun新上了香港cloudie机房的香港原生IP的VPS,写的是默认接入200Mbps带宽(共享),基于KVM虚拟,纯SSD RAID10,三网直连,混合超售的CN2网络,商家对VPS的I/O有大致100MB/S的限制。由于是原生香港IP,所以这个VPS还是有一定的看头的,这里给大家弄个测评,数据仅供参考!9折优惠码:hostyun,循环优惠内存CPUSSD流量带宽价格购买1G1核10G3...

2021HawkHost老鹰主机黑色星期五虚拟主机低至3.5折 永久4.5折

老鹰主机HawkHost是个人比较喜欢的海外主机商,如果没有记错的话,大约2012年左右的时候算是比较早提供支付宝付款的主机商。当然这个主机商成立时间更早一些的,由于早期提供支付宝付款后,所以受众用户比较青睐,要知道我们早期购买海外主机是比较麻烦的,信用卡和PAYPAL还没有普及,大家可能只有银联和支付宝,很多人选择海外主机还需要代购。虽然如今很多人建站少了,而且大部分人都用云服务器。但是老鹰主机...

创梦网络-江苏宿迁BGP云服务器100G高防资源,全程ceph集群存储,安全可靠,数据有保证,防护真实,现在购买7折促销,续费同价!

官方网站:点击访问创梦网络宿迁BGP高防活动方案:机房CPU内存硬盘带宽IP防护流量原价活动价开通方式宿迁BGP4vCPU4G40G+50G20Mbps1个100G不限流量299元/月 209.3元/月点击自助购买成都电信优化线路8vCPU8G40G+50G20Mbps1个100G不限流量399元/月 279.3元/月点击自助购买成都电信优化线路8vCPU16G40G+50G2...

android5.1为你推荐
支持ipad支持ipad重庆宽带测速重庆云阳电信宽带测速网址谁知道,帮个忙?ipad如何上网ipad怎么设置网络?windows键是哪个Windows键是哪个键啊?win10关闭445端口如何进入注册表修改关闭445端口iexplore.exe应用程序错误iexplore.exe---应用程序错误.是什么意思?css下拉菜单html+css下拉菜单怎么制作phpecho在php中 echo和print 有什么区别xp关闭445端口Windows XP系统 关闭445端口后无法上网,求解?
重庆虚拟空间 二级域名申请 hostmaster iisphpmysql 12306抢票攻略 win8.1企业版升级win10 typecho debian7 hnyd 天互数据 anylink 免费防火墙 cn3 广州服务器 电信虚拟主机 免费phpmysql空间 搜索引擎提交入口 空间购买 海外空间 沈阳主机托管 更多