use of com.android.tools.fd.client.InstantRunPushFailedException in project android by JetBrains.
the class HotSwapTask method perform.
@Override
public boolean perform(@NotNull final IDevice device, @NotNull LaunchStatus launchStatus, @NotNull ConsolePrinter printer) {
InstantRunManager manager = InstantRunManager.get(myProject);
UpdateMode updateMode = null;
try {
InstantRunClient instantRunClient = InstantRunManager.getInstantRunClient(myInstantRunContext);
if (instantRunClient == null) {
return terminateLaunch(launchStatus, "Unable to connect to application. Press Run or Debug to rebuild and install the app.");
}
updateMode = manager.pushArtifacts(device, myInstantRunContext, myRestartActivity ? UpdateMode.WARM_SWAP : UpdateMode.HOT_SWAP);
printer.stdout("Hot swapped changes, activity " + (updateMode == UpdateMode.HOT_SWAP ? "not restarted" : "restarted"));
} catch (InstantRunPushFailedException | IOException e) {
return terminateLaunch(launchStatus, "Error installing hot swap patches: " + e);
}
InstantRunStatsService.get(myProject).notifyDeployType(DeployType.HOTSWAP, myInstantRunContext, device);
return true;
}
Aggregations