Skip to content

rbm lock device

inazaruk edited this page Jan 19, 2012 · 11 revisions

rbm-lock-device

Go to home | documentation | ant tasks

Selects the best matching device or emulator and stores serial number in current context. This serial number is then used by all other "device" tasks by default. This task is designed to make it easier to use other related tasks.


Prototype

<rbm-lock-device serial="${emulator-serial}" 
                 verify="${verify}" 
                 emulator="${emulator}" 
                 device="${device}"
                 useFirst="${use.first.matching}" />

Attributes

  • serial - optional, explicitly set serial number. In this case device, emulator and useFirst attributes are ignored. If this attribute is omitted serial number is detected automatically by the task.

  • verify - optional, default: true. If this is true, the task verifies that device with specified serial is connected to adb. If false, check is skipped. This has effect only when serial is used (to verify that device with such serial number is actually connected to adb).

  • emulator - optional, if this is set to true, only emulators are considered for being locked. And real devices are ignored. Note that if this attribute is used, device attribute should not be used. If neither emulator nor device are used, all connected devices are considered for being locked.

  • device - optional, if this is set to true, only real devices are considered. And all connected emulators are ignored. Note that if this attribute is used, emulator attribute should not be used. If neither emulator nor device are used, all connected devices are considered for being locked.

  • useFirst - optional, default - false. If several devices match the criteria and this attribute is set to true, the first one on the list is used. If this attribute is false and several devices match criteria, task will fail the build.


Examples

Assuming there only one device connected to adb:

<rbm-lock-device />

And if you want to connect to specific device using its serial number:

<rbm-lock-device serial="${emulator-serial}" />

If you want to use emulators only and select first if there were several connected:

<rbm-lock-device emulator="true" useFirst="true" />

Or devices:

<rbm-lock-device device="true" useFirst="true" />

Go to home | documentation | ant tasks

Clone this wiki locally