Launches the activity on targeted device
try {
String msg = String.format("Starting activity %1$s on device ", mActivity,
device);
AdtPlugin.printToConsole(info.getProject(), msg);
// In debug mode, we need to add the info to the list of application monitoring
// client changes.
// increment launch attempt count, to handle retries and timeouts
info.incrementAttemptCount();
// now we actually launch the app.
device.executeShellCommand("am start" //$NON-NLS-1$
+ (info.isDebugMode() ? " -D" //$NON-NLS-1$
: "") //$NON-NLS-1$
+ " -n " //$NON-NLS-1$
+ info.getPackageName() + "/" //$NON-NLS-1$
+ mActivity.replaceAll("\\$", "\\\\\\$"), //$NON-NLS-1$ //$NON-NLS-2$
new AMReceiver(info, device, mLaunchController));
// if the app is not a debug app, we need to do some clean up, as
// the process is done!
if (info.isDebugMode() == false) {
// stop the launch object, since there's no debug, and it can't
// provide any control over the app
return false;
}
} catch (IOException e) {
// something went wrong trying to launch the app.
// lets stop the Launch
AdtPlugin.printErrorToConsole(info.getProject(),
String.format("Launch error: %s", e.getMessage()));
return false;
}
return true;