Run Trade Federation with specific device

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Run Trade Federation with specific device

Kuanlin Chen
According to

My question is how to specify one device while running tradefed ?

I wrote a sample class like this, but I have no idea how to use setDevice().
public class HelloWorld implements IRemoteTest, IDeviceTest {

@Option(name = "device", description = "Run with specific device", importance=Option.Importance.ALWAYS)
private String serialNumber = "test";
private ITestDevice mDevice;

public void setDevice(ITestDevice device) {
= device;

public ITestDevice getDevice() {
return mDevice;

public void run(ITestInvocationListener listener) throws DeviceNotAvailableException {
((ITestDevice)serialNumber);  // <== How to convert String to ITestDevice ?
LogUtil.CLog.i("Hello, TF World! I have device %s", getDevice().getSerialNumber());

You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at
For more options, visit