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

LayerStack$10.04/月(可选中国香港、日本、新加坡和洛杉矶)高性能AMD EPYC (霄龙)云服务器,

LayerStack(成立于2017年),当前正在9折促销旗下的云服务器,LayerStack的云服务器采用第 3 代 AMD EPYC™ (霄龙) 处理器,DDR4内存和企业级 PCIe Gen 4 NVMe SSD。数据中心可选中国香港、日本、新加坡和洛杉矶!其中中国香港、日本和新加坡分为国际线路和CN2线路,如果选择CN2线路,价格每月要+3.2美元,付款支持paypal,支付宝,信用卡等!...

Tudcloud(月付7.2美元),香港VPS,可选大带宽或不限流量

Tudcloud是一家新开的主机商,提供VPS和独立服务器租用,数据中心在中国香港(VPS和独立服务器)和美国洛杉矶(独立服务器),商家VPS基于KVM架构,开设在香港机房,可以选择限制流量大带宽或者限制带宽不限流量套餐。目前提供8折优惠码,优惠后最低每月7.2美元起。虽然主机商网站为英文界面,但是支付方式仅支付宝和Stripe,可能是国人商家。下面列出部分VPS主机套餐配置信息。CPU:1cor...

HostYun(月18元),CN2直连香港大带宽VPS 50M带宽起

对于如今的云服务商的竞争着实很激烈,我们可以看到国内国外服务商的各种内卷,使得我们很多个人服务商压力还是比较大的。我们看到这几年的服务商变动还是比较大的,很多新服务商坚持不超过三个月,有的是多个品牌同步进行然后分别的跑路赚一波走人。对于我们用户来说,便宜的服务商固然可以试试,但是如果是不确定的,建议月付或者主力业务尽量的还是注意备份。HostYun 最近几个月还是比较活跃的,在前面也有多次介绍到商...

android5.1为你推荐
psbAchrome用户重庆courses163supplementedrouteToolgraph支持ipad支持ipad国家标准苹果5win7telnet怎样开启Windows7系统中的Telnet服务迅雷下载速度为什么现在迅雷下载的速度比原来慢得多?
中文域名查询 俄罗斯vps 已经备案域名 securitycenter 网站监控 云鼎网络 本网站在美国维护 softbank邮箱 可外链相册 服务器硬件防火墙 东莞idc 带宽租赁 lamp兄弟连 阿里云邮箱怎么注册 cpu使用率过高怎么办 easypanel 德国代理ip 海尔t68g 衡天主机 流媒体服务器软件 更多