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

PacificRack - 洛杉矶QN机房 低至年$7.2 同有站群多IP地址VPS主机

需要提前声明的是有网友反馈到,PacificRack 商家是不支持DD安装Windows系统的,他有安装后导致服务器被封的问题。确实有一些服务商是不允许的,我们尽可能的在服务商选择可以直接安装Windows系统套餐,毕竟DD安装的Win系统在使用上实际上也不够体验好。在前面有提到夏季促销的"PacificRack夏季促销PR-M系列和多IP站群VPS主机 年付低至19美元"有提到年付12美元的洛杉...

LOCVPS-2021年6月香港便宜vps宽带升级,充值就送代金券,其它八折优惠!

LOCVPS怎么样?LOCVPS是一家成立于2011年的稳定老牌国人商家,目前提供中国香港、韩国、美国、日本、新加坡、德国、荷兰等区域VPS服务器,所有机房Ping延迟低,国内速度优秀,非常适合建站和远程办公,所有机房Ping延迟低,国内速度优秀,非常适合做站。XEN架构产品的特点是小带宽无限流量、不超售!KVM架构是目前比较流行的虚拟化技术,大带宽,生态发展比较全面!所有大家可以根据自己业务需求...

RAKsmart 2021新年新增韩国服务器及香港美国日本VPS半价

RAKsmart 商家我们肯定不算陌生,目前主要的营销客户群肯定是我们。于是在去年的时候有新增很多很多的机房,比如也有测试过的日本、香港、美国机房,这不今年有新增韩国机房(记得去年是不是也有增加过)。且如果没有记错的话,之前VPS主机也有一次磁盘故障的问题。 这不今天有看到商家新增韩国服务器产品,当然目前我还不清楚商家韩国服务器的线路和速度情况,后面我搞一台测试机进行...

android5.1为你推荐
投标迅雷Testto贵州省127浙江世纪华通集团股份有限公司支持ipad支持ipadwindows键是哪个Windows键是哪个键啊?迅雷雷鸟迅雷会员每日免费抽奖,抽中迅雷的雷鸟披肩了,要钱吗苹果5.1.1越狱iphone 用itunes更新5.1.1需要重新越狱?然后cydia也没有了。webmessengerMSN无法登陆怎么办啊?
vps服务器租用 独享100m 韩国空间 网站实时监控 国外在线代理 上海域名 域名转接 双十一秒杀 速度云 流量计费 免费mysql数据库 华为云盘 yundun 全能空间 注册阿里云邮箱 accountsuspended phpwind论坛 游戏服务器 电脑主机结构图 杭州主机托管 更多