Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
W
hen using an IDE (Integrated Adb
Development Environment) like Adb stands for ‘Android Debug Bridge’. Adb has a client-
Eclipse, the developer never realises server mechanism, where the ‘client’ is the Android
the existence of these utilities, because Emulator instance, or the Android device that’s connected
IDEs provide an abstraction between the developer and to the PC, and the ‘server’ is your development machine
the implementation of the process to create an application (PC). The server communicates with client(s) through a
package. We, being open source enthusiasts and Linux daemon process which runs on the PC. The adb server
users, should know how to build an application from can have multiple clients: for example, two emulator
the command line, and also be aware of exactly what instances and one Android phone connected via USB. To
is going on behind the scenes. This gives us a better find clients available on the development machine, run
understanding of the process of creating an Android the following command:
application and will also help in debugging.
Under Tools directory in the folder where the Android $ adb devices
SDK is installed there are many command-line utilities.
Let’s look at those that are used most often in the Figure 1 shows sample results of running the
following sections of this article: command.
adb
android Having obtained the list of clients, we can run a
ddms command targeting a particular client/instance, by adding
emulator the -s <serial-number> parameter to the command,
mksdcard where serial-number is one of the device names listed by
sqlite3 the adb devices command. For example:
traceview
$ adb -s emulator-5554 shell
You can update the Android platform on your ons, etc, by launching the SDK and AVD Manager with the
development machine with the latest Android releases, add- simple command, android. This is illustrated in Figure 6.
Figure 9: Emulator: simulated incoming call Figure 10: Emulator instance control console
DDMS on the emulator, and also see the CPU load, etc, on the
The Dalvik Debug Monitoring Service is a debugger tool that SysInfo tab (see Figure 8). You can even test an application’s
lets you debug an application running on the Android device, handling of incoming phone calls by simulating a call to the
remotely, which is your development machine. To launch it, emulator instance, by entering the ‘calling’ phone number in
run ddms. Figure 7 shows what the DDMS screen looks like. the ‘Incoming Number’ field on the Emulator Control tab.
When the debugger launches, it automatically attaches Figure 9 is a screen capture of the emulator, showing the
to running emulator instances/devices. You can view the result of this action.
processes running on each instance in the left pane. The right We can also view the heap status of the device, by causing
pane has tabs to monitor process and emulator properties. You garbage collection on the device, with the following steps:
can see the memory usage of each of the applications running 1. Select a process from the left pane.