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

天上云月付572元,起香港三网CN2直连,独立服务器88折优惠,香港沙田机房

天上云怎么样?天上云隶属于成都天上云网络科技有限公司,是一家提供云服务器及物理服务器的国人商家,目前商家针对香港物理机在做优惠促销,香港沙田机房采用三网直连,其中电信走CN2,带宽为50Mbps,不限制流量,商家提供IPMI,可以自行管理,随意安装系统,目前E3-1225/16G的套餐低至572元每月,有做大规模业务的朋友可以看看。点击进入:天上云官方网站天上云香港物理机服务器套餐:香港沙田数据中...

618云上Go:腾讯云秒杀云服务器95元/年起,1C2G5M三年仅288元起

进入6月,各大网络平台都开启了618促销,腾讯云目前也正在开展618云上Go活动,上海/北京/广州/成都/香港/新加坡/硅谷等多个地区云服务器及轻量服务器秒杀,最低年付95元起,参与活动的产品还包括短信包、CDN流量包、MySQL数据库、云存储(标准存储)、直播/点播流量包等等,本轮秒杀活动每天5场,一直持续到7月中旬,感兴趣的朋友可以关注本页。活动页面:https://cloud.tencent...

如何低价香港服务器购买?有没有便宜的香港服务器推荐?

如何低价香港服务器购买?想要做一个个人博客,想用香港服务器,避免繁琐备案,性能不需要多高,只是记录一些日常而已,也没啥视频之类的东西,想问问各位大佬有没有低价的香港服务器推荐?香港距大陆近,相比美国服务器最大的优势在于延迟低,ping值低,但是带宽紧张,普遍都是1M,一般戏称其为“毛细血管”。同时价格普遍高,优质稳定的一般价格不菲。大厂云梯队阿里云、腾讯云两家都有香港服务器,要注意的是尽量不要选择...

android5.1为你推荐
蓝牙itunesformgraph支持ipad支持ipad南京医科大学合同管理系统重庆宽带测速重庆市电信网速测试是哪个网站或ipiexplore.exe应用程序错误iexplore.exe应用程序错误win10445端口WIN7怎么打开3306端口phpecho为什么在PHP中使用echo FALSE;什么也输出不了?应该如何输出FALSE?谢谢!360chrome360Chrome 世界之窗极速浏览器 ChromePlus
如何查询域名备案号 中国万网虚拟主机 万网域名解析 网易域名邮箱 国外私服 搜狗抢票助手 lamp配置 地址大全 韩国网名大全 ca4249 建立邮箱 可外链相册 免费申请网站 四核服务器 smtp服务器地址 免费php空间 服务器硬件配置 美国主机 免费的加速器 cx域名 更多