AndroidUserland

freakingtux edited this page Mar 22, 2012 · 11 revisions

Android Userland

Emulator mount points

The Android file system hierarchy does not follow the Linux file system hierarchy and partition layout strategy. A default android 2.2 image contains the following disk mounts

Mount point Description RW
“/” The root file system. this partition is Usually read only (you can use adb remount to make it read-write on the emulator)
“/system” Is the System partition containing all the core system binaries This one is also read-only
“/data” This partition contains installed packages it usually writeable
/cache Place where dex optimized dalvik bitecode is put Read-Write
/mnt/sdcard VFAT VFAT Read-Write
/mnt/sdcard/asec VFAT VFAT Read-Write “secure?”

System processes

Path User Comments
/init root Next to the init this is also the place where device nodes are created by listening to uevents
/system/bin/servicemanager system Core binder naming service (broker)
/system/bin/vold root Volume manager that listens to kernel netlink events and mounts media
/system/bin/netd root Communication daemon
/system/bin/rild radio Does modem communication
zygote root A process that is loaded at startup and that instantiate a JVM and preload libraries. This process is forked to start new processes. And is also forked
/system/bin/mediaserver media
/system/bin/keystore keystore (frameworks/base/cmds/keystore) KeyStore is a secured storage for key-value pairs.
/system/bin/system_server system Key server in android performing most critical task and providing most services. Combinatio of cpp and java code. The system server communicates with vold/rild etc
/system/bin/installd root Native package management daemon

Android system commands

system/bin
|-- adb The Android Debug Bridge 
|-- am Activity Manager client 
|-- applypatch 
|-- applypatch_static
|-- app_process This is the main Android executable(zygote) forking itself to start other java processes
|-- audioloop
|-- BlobCache_test
|-- bmgr
|-- bootanimation
|-- bu
|-- bugreport
|-- cat -> toolbox
|-- check_prereq
|-- chmod -> toolbox
|-- chown -> toolbox
|-- cmp -> toolbox
|-- dalvikvm The Dalvik virtual machine. This virtual machine runs "dex" code
|-- date -> toolbox
|-- dbus-daemon
|-- dd -> toolbox
|-- debuggerd
|-- decoder
|-- dexopt
|-- df -> toolbox
|-- dhcpcd
|-- dmesg -> toolbox
|-- dnsmasq
|-- drmserver
|-- dumpstate
|-- dumpsys (dump system state)
|-- flash_image
|-- fsck_msdos
|-- gdbjithelper
|-- gdbserver The GNU debug server tool
|-- getevent -> toolbox
|-- getprop -> toolbox (get system properties)
|-- gzip
|-- hd -> toolbox
|-- hostapd
|-- hostapd_cli
|-- id -> toolbox
|-- ifconfig -> toolbox
|-- iftop -> toolbox
|-- ime
|-- input
|-- InputChannel_test
|-- InputDispatcher_test
|-- InputEvent_test
|-- InputPublisherAndConsumer_test
|-- InputReader_test
|-- insmod -> toolbox
|-- installd
|-- ioctl -> toolbox
|-- ionice -> toolbox
|-- ip
|-- ip6tables
|-- iptables
|-- keystore
|-- keystore_cli
|-- kill -> toolbox
|-- linker The android elf linker
|-- ln -> toolbox Create symbolic links
|-- log -> toolbox Command line tool to send messaqe 
|          to the log queue
|-- logcat show logging outout
|-- logwrapper Forks and executes programs, redirecting 
|              stdout and stderr to the Android logging 
|              system.
|-- Looper_test
|-- ls -> toolbox list files
|-- lsmod -> toolbox list loaded kernel modules
|-- lsof -> toolbox list open files
|-- make_ext4fs 
|-- mediaserver
|-- mkdir -> toolbox Make directory
|-- mksh MirBSD Korn shell
|-- monkey
|-- mount -> toolbox mount file system
|-- mtpd
|-- mv -> toolbox move files
|-- nandread -> toolbox
|-- ndc
|-- netcfg
|-- netd
|-- netstat -> toolbox
|-- newfs_msdos -> toolbox
|-- notify -> toolbox
|-- ObbFile_test
|-- omx_tests
|-- ping
|-- ping6
|-- pm
|-- pppd
|-- printenv -> toolbox
|-- ps -> toolbox
|-- qemud
|-- qemu-props
|-- r -> toolbox
|-- racoon
|-- radiooptions
|-- reboot -> toolbox
|-- record
|-- recordvideo
|-- recovery
|-- renice -> toolbox
|-- rild
|-- rm -> toolbox
|-- rmdir -> toolbox
|-- rmmod -> toolbox
|-- route -> toolbox
|-- run-as
|-- schedtest
|-- schedtop -> toolbox
|-- screencap
|-- screenshot
|-- sdcard
|-- sendevent -> toolbox
|-- sensorservice
|-- service
|-- servicemanager
|-- setconsole -> toolbox
|-- setprop -> toolbox (set system properties)
|-- sf2
|-- sh -> mksh
|-- showlease
|-- simg2img
|-- skia_test
|-- sleep -> toolbox
|-- smd -> toolbox
|-- stagefright
|-- start -> toolbox
|-- stop -> toolbox
|-- stream
|-- String8_test
|-- surfaceflinger
|-- svc
|-- sync -> toolbox
|-- system_server
|-- tc
|-- testid3
|-- toolbox
|-- top -> toolbox
|-- touch -> toolbox
|-- umount -> toolbox
|-- Unicode_test
|-- updater
|-- uptime -> toolbox
|-- vdc
|-- vmstat -> toolbox
|-- vold disk volume daemon
|-- watchprops -> toolbox
|-- wipe -> toolbox
|-- wpa_cli
|-- wpa_supplicant
+-- ZipFileRO_test

Starting android 4.0 engineering builds have quite a few more commands present in system/xbin most of them look like they are mostly debugging tools

|-- directiotest
|-- latencytop
|-- librank
|-- micro_bench
|-- netperf
|-- netserver
system/xbin
|-- add-property-tag (recovery) add-property-tag change properties in default.prop or build.prop Normally used to modify build properties to record incremental updates.
|-- btool            (recovery) btool Backs up your data.?? 
|-- check-lost+found (recovery) check-lost+found => puts a file on the file system , reboots and performs a file system check *stops 
|-- cpueater         (extras/testing) cpueater Simple cpu eater busy loop. Runs as a daemon. Prints the child PID to std so you can easily kill it later.
|-- daemonize        (extras/testing) daemonize daemonize program and can start them with a delay
|-- dbus-monitor     (external/dbus) dbus-monitor program to use to monitor dbus message (probably only used with the Bluetooth stack)
|-- dbus-send        (external/dbus) dbus-send tool to send dbus messages from the command line
|-- dexdump          The "dexdump" tool is intended to mimic "objdump".  But the output makes me thing of javap 
|-- dhdutil
|-- directiotest
|-- latencytop
|-- librank
|-- micro_bench
|-- nc               The TCP/IP Swiss army knife!
|-- netperf
|-- netserver
|-- opcontrol        oprofile related tool
|-- oprofiled        oprofile related tool
|-- procmem
|-- procrank
|-- rawbu
|-- sane_schedstat
|-- scp              Android cross plaform copy program
|-- showmap
|-- showslab
|-- sqlite3
|-- ssh              SescureShell for remote access
|-- strace           trace system calls
|-- su		     SuperUser become an other user
|-- tcpdump	     Dump raw traffic data that comes over an interface
+-- timeinfo

Android build system commands (host tools)

|-- (releasetools) build/tools/releasetools/sign_target_files_apks
|-- (releasetools) build/tools/releasetools/img_from_target_files
|-- (releasetools) build/tools/releasetools/ota_from_target_files
|-- (releasetools) build/tools/releasetools/check_target_files_signatures

Android host tools

out/host/linux-x86/bin
|-- aapt aapt Android Asset Packaging Tool (can be used to create an query resource of apk packages).
|-- acp  acp Android copy tool to have a single cp tools to copy files. See build/tools/acp/README more information).
|-- adb  adb Android debug bridge. very usefull tool to connect to your android device. http://developer.android.com/guide/developing/tools/adb.html
|-- aidl aidl Android interface stub generator.
|-- android  android main entry point to create android projects, download android platform-sdk's and create virtual machines.http://developer.android.com/guide/developing/tools/android.html
|-- apicheck (external/doclava) Compares two api xml files for consistency (the xml files are generated based on a java doclet)
|-- apkcheck
|-- aprotoc
|-- atree
|-- bb2sym
|-- bb_dump
|-- bbprof
|-- bison
|-- bsdiff
|-- bspatch
|-- cfassembler
|-- check_stack
|-- check_trace
|-- clang
|-- clang-tblgen
|-- cmu2nuance
|-- coverage
|-- dalvik
|-- dalvikvm
|-- dasm
|-- ddms
|-- dexdeps
|-- dexdump
|-- dexlist
|-- dexopt
|-- dictTest
|-- dmtracedump
|-- draw9patch
|-- dumpeventlog
|-- dump_regions
|-- dx
|-- dx-tests
|-- edify
|-- elftree
|-- emulator
|-- emulator-arm
|-- emulator-ui
|-- emulator-x86
|-- etc1tool
|-- eventanalyzer
|-- exc_dump
|-- fastboot
|-- fs_config
|-- fs_get_stats
|-- genext2fs
|-- gpttool
|-- grxmlcompile
|-- hierarchyviewer
|-- hierarchyviewer1
|-- hist_trace
|-- hprof-conv
|-- icudata
|-- imgdiff
|-- jdwpspy
|-- line_endings
|-- llvm-link
|-- llvm-rs-cc
|-- localize
|-- make_cfst
|-- makedict
|-- make_ext4fs
|-- make_g2g
|-- makekeycodes
|-- make_ve_grammar
|-- minigzip
|-- mkbootfs
|-- mkbootimg
|-- mksdcard
|-- mksnapshot
|-- mkuserimg.sh
|-- mkyaffs2image
|-- monkeyrunner
|-- obbtool
|-- parseStringTest
|-- post_trace
|-- profile_pid
|-- profile_trace
|-- q2dm
|-- q2g
|-- qemu-android-arm
|-- qemu-android-x86
|-- read_addr
|-- read_method
|-- read_pid
|-- read_trace
|-- rgb2565
|-- rsg-generator
|-- rs-spec-gen
|-- screenshot2
|-- sig
|-- sig-check
|-- sig-create
|-- simg2img
|-- sqlite3
|-- stack_dump
|-- tblgen
|-- test_algorithm_host
|-- test_char_traits_host
|-- test_functional_host
|-- test_g2g
|-- test_iomanip_host
|-- test_ios_base_host
|-- test_ios_pos_types_host
|-- test_iostream_host
|-- test_iterator_host
|-- test_limits_host
|-- test_list_host
|-- test_memory_host
|-- test_set_host
|-- test_sstream_host
|-- test_streambuf_host
|-- test_string_host
|-- test_swiarb
|-- test_type_traits_host
|-- test_uninitialized_host
|-- test_vector_host
|-- test_zipfile
|-- traceview
|-- usbtest
|-- vm-tests
|-- wdsclient
|-- webkitmerge
|-- yuv420sp2rgb
+-- zipalign