Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

== 2014-09-17 == #13

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 55 additions & 1 deletion META-INF/plugin.xml
Expand Up @@ -13,6 +13,9 @@
<li>ADB Restart App</li>
<li>ADB Clear App Data</li>
<li>ADB Clear App Data and Restart</li>
<li>ADB Start App With Debugger</li>
<li>ADB Restart App With Debugger</li>
<li>ADB Clear App Data and Restart With Debugger</li>
</ul>
<br />
There are two basic ways to invoke a command:
Expand Down Expand Up @@ -56,34 +59,85 @@
class="com.developerphil.adbidea.action.UninstallAction"
text="ADB Uninstall App"
description="Uninstalls the current application">
<keyboard-shortcut first-keystroke="control alt 0" keymap="$default"/>
</action>

<action id="com.developerphil.adbidea.action.KillAction"
class="com.developerphil.adbidea.action.KillAction"
text="ADB Kill App"
description="Kills the current application">
<keyboard-shortcut first-keystroke="control alt 1" keymap="$default"/>
</action>
<action id="com.developerphil.adbidea.action.StartAction"
class="com.developerphil.adbidea.action.StartAction"
text="ADB Start App"
description="Starts the current application">
<keyboard-shortcut first-keystroke="control alt 2" keymap="$default"/>
</action>
<action id="com.developerphil.adbidea.action.RestartAction"
class="com.developerphil.adbidea.action.RestartAction"
text="ADB Restart App"
description="Restarts the current application">
<keyboard-shortcut first-keystroke="control alt 3" keymap="$default"/>
</action>
<action id="com.developerphil.adbidea.action.ClearDataAction"
class="com.developerphil.adbidea.action.ClearDataAction"
text="ADB Clear App Data"
description="Clears the private storage of the app">
<keyboard-shortcut first-keystroke="control alt 4" keymap="$default"/>
</action>
<action id="com.developerphil.adbidea.action.ClearDataAndRestartAction"
class="com.developerphil.adbidea.action.ClearDataAndRestartAction"
text="ADB Clear App Data and Restart"
description="Clears the private storage of the app and restarts it">
<keyboard-shortcut first-keystroke="control alt 5" keymap="$default"/>
</action>
<add-to-group group-id="AndroidToolsGroup" anchor="first"/>

<!-- DEBUGGING ENABLED -->
<action id="com.developerphil.adbidea.action.StartWithDebuggerAction"
class="com.developerphil.adbidea.action.StartWithDebuggerAction"
text="ADB Start App With Debugger"
description="Starts the current application">
<keyboard-shortcut first-keystroke="control alt 6" keymap="$default"/>
</action>
<action id="com.developerphil.adbidea.action.RestartWithDebuggerAction"
class="com.developerphil.adbidea.action.RestartWithDebuggerAction"
text="ADB Restart App With Debugger"
description="Restarts the current application">
<keyboard-shortcut first-keystroke="control alt 7" keymap="$default"/>
</action>
<action id="com.developerphil.adbidea.action.ClearDataAndRestartWithDebuggerAction"
class="com.developerphil.adbidea.action.ClearDataAndRestartWithDebuggerAction"
text="ADB Clear App Data and Restart With Debugger"
description="Clears the private storage of the app and restarts it">
<keyboard-shortcut first-keystroke="control alt 8" keymap="$default"/>
</action>
<!-- <add-to-group group-id="AndroidToolsGroup" anchor="first"/> -->
<add-to-group group-id="MainMenu" relative-to-action="ToolsMenu" anchor="after"/>
</group>
<action id="ADBIdeaKillApp"
class="com.developerphil.adbidea.action.KillAction"
text="Adb Idea Kill App"
icon="/icons/circle_stop.png"
description="Adb Idea Kill App">
<add-to-group group-id="ToolbarRunGroup" anchor="after" relative-to-action="AndroidConnectDebuggerAction"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt 1"/>
</action>
<action id="ADBIdeaDebugApp"
class="com.developerphil.adbidea.action.RestartWithDebuggerAction"
text="Adb Idea Debug App"
icon="/icons/circle_debug.png"
description="Adb Idea Debug App">
<add-to-group group-id="ToolbarRunGroup" anchor="after" relative-to-action="AndroidConnectDebuggerAction"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt 7"/>
</action>
<action id="ADBIdeaRunApp"
class="com.developerphil.adbidea.action.RestartAction"
text="Adb Idea Run App"
icon="/icons/circle_run.png"
description="Adb Idea Debug App">
<add-to-group group-id="ToolbarRunGroup" anchor="after" relative-to-action="AndroidConnectDebuggerAction"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt 3"/>
</action>
</actions>
</idea-plugin>
1 change: 1 addition & 0 deletions adb_idea.iml
Expand Up @@ -6,6 +6,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
7 changes: 5 additions & 2 deletions build.xml
Expand Up @@ -312,7 +312,7 @@
<patternset refid="excluded.from.compilation.adb_idea"/>
</javac2>

<copy todir="${adb_idea.testoutput.dir}">
<copy todir="${adb_idea.testoutputdir}">
<fileset dir="${module.adb_idea.basedir}/test">
<patternset refid="compiler.resources"/>
<type type="file"/>
Expand All @@ -333,9 +333,12 @@
<jar destfile="${adb_idea.plugin.path.jar}" duplicate="preserve">
<zipfileset dir="${module.adb_idea.basedir}/out/production/adb_idea"/>
<zipfileset file="${module.adb_idea.basedir}/META-INF/plugin.xml" prefix="META-INF"/>
<zipfileset file="${module.adb_idea.basedir}/res/icons/circle_stop.png" prefix="icons"/>
<zipfileset file="${module.adb_idea.basedir}/res/icons/circle_run.png" prefix="icons"/>
<zipfileset file="${module.adb_idea.basedir}/res/icons/circle_debug.png" prefix="icons"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Manifest-Version" value="1.2"/>
</manifest>
</jar>
</target>
Expand Down
Binary file added res/icons/circle_debug.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/icons/circle_run.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/icons/circle_stop.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,14 @@
package com.developerphil.adbidea.action;

import com.developerphil.adbidea.adb.AdbFacade;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;

public class ClearDataAndRestartWithDebuggerAction extends AdbAction {

public void actionPerformed(AnActionEvent e, Project project) {
AdbFacade.clearDataAndRestartWithDebugger(project);
}


}
@@ -0,0 +1,12 @@
package com.developerphil.adbidea.action;

import com.developerphil.adbidea.adb.AdbFacade;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;

public class RestartWithDebuggerAction extends AdbAction {

public void actionPerformed(AnActionEvent e, Project project) {
AdbFacade.restartDefaultActivityWithDebugger(project);
}
}
12 changes: 12 additions & 0 deletions src/com/developerphil/adbidea/action/StartWithDebuggerAction.java
@@ -0,0 +1,12 @@
package com.developerphil.adbidea.action;

import com.developerphil.adbidea.adb.AdbFacade;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;

public class StartWithDebuggerAction extends AdbAction {

public void actionPerformed(AnActionEvent e, Project project) {
AdbFacade.startDefaultActivityWithDebugger(project);
}
}
12 changes: 12 additions & 0 deletions src/com/developerphil/adbidea/adb/AdbFacade.java
Expand Up @@ -47,6 +47,18 @@ public static void clearDataAndRestart(Project project) {
executeOnDevice(project, new ClearDataAndRestartCommand());
}

public static void startDefaultActivityWithDebugger(Project project) {
executeOnDevice(project, new StartDefaultActivityCommandWithDebugger());
}

public static void restartDefaultActivityWithDebugger(Project project) {
executeOnDevice(project, new RestartPackageCommandWithDebugger());
}

public static void clearDataAndRestartWithDebugger(Project project) {
executeOnDevice(project, new ClearDataAndRestartCommandWithDebugger());
}

private static void executeOnDevice(final Project project, final Command runnable) {
final DeviceResult result = getDevice(project);
if (result != null) {
Expand Down
@@ -0,0 +1,7 @@
package com.developerphil.adbidea.adb.command;

public class ClearDataAndRestartCommandWithDebugger extends CommandList {
public ClearDataAndRestartCommandWithDebugger() {
super(new ClearDataCommand(), new StartDefaultActivityCommandWithDebugger());
}
}
@@ -0,0 +1,8 @@
package com.developerphil.adbidea.adb.command;

public class RestartPackageCommandWithDebugger extends CommandList {

public RestartPackageCommandWithDebugger() {
super(new KillCommand(), new StartDefaultActivityCommandWithDebugger());
}
}