Skip to content

Commit 351f2cf

Browse files
authored
Merge pull request pbreault#122 from VovaStelmashchuk/master
Fixed critical code error and update develop.md
2 parents 1654aa0 + be33347 commit 351f2cf

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

DEVELOP.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@ Run/Debug
22
=========
33

44
* Open project in intellij
5+
* Create gradle.properties file, use [instruction](gradle.properties.change_me)
56
* Open _edit configurations_ to create a new run/debug configuration
6-
* Choose a new gradle configuration and name it `build and run` that runs <code>./gradlew buildPlugin runIdea</code>
7+
* Choose a new gradle configuration and name it `build and run` that runs `./gradlew buildPlugin runIde`
78
![Create debug configuration](website/debug_howto.png)
89
* hit debug button as usual
910

1011
Running from command line
1112
-------------------------
12-
<code>
13-
./gradlew buildPlugin runIdea
14-
</code>
13+
* Create gradle.properties file, use [instruction](gradle.properties.change_me)
14+
* Execute command
15+
```shell script
16+
./gradlew buildPlugin runIde
17+
```
1518

1619
Create new menu item
1720
====================
1821

19-
* Add entry to plugin.xml (below line 100)
20-
<code>
21-
22+
* Add entry to plugin.xml inside actions tab (below line 100)
23+
```xml
2224
<action id="com.developerphil.adbidea.action.NewAction"
2325
class="com.developerphil.adbidea.action.NewAction"
2426
text="New Action"
2527
description="Playing with the plugin">
2628
</action>
27-
</code>
29+
```
2830

2931
* Create and implement a new `NewAction` class that extends from `AdbAction` (you can create that from the plugin view, right click on the class name and choose `create class`
3032
* implement its abstract methods
31-
* add new entry in `QuickListAction.java` like this
32-
<code>
33-
34-
addAction("com.developerphil.adbidea.action.NewAction", group);
35-
</code>
33+
* add new entry in `QuickListAction.kt` like this
34+
```kotlin
35+
addAction("com.developerphil.adbidea.action.NewAction", group)
36+
```

src/main/kotlin/com/developerphil/adbidea/adb/UseSameDevicesHelper.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package com.developerphil.adbidea.adb
22

33
import com.android.ddmlib.IDevice
44
import com.developerphil.adbidea.preference.ProjectPreferences
5-
import javax.inject.Inject
65

7-
class UseSameDevicesHelper @Inject constructor(private val projectPreferences: ProjectPreferences, private val bridge: Bridge) {
6+
class UseSameDevicesHelper constructor(private val projectPreferences: ProjectPreferences, private val bridge: Bridge) {
87

98
var previouslyConnectedDevices: List<IDevice>? = null
109

src/main/kotlin/com/developerphil/adbidea/debugger/Debugger.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class Debugger(private val project: Project, private val device: IDevice, privat
2626

2727
private fun closeOldSessionAndRun(androidDebugger: AndroidDebugger<*>, client: Client) {
2828
terminateRunSessions(client)
29-
androidDebugger.attachToClient(project, client, null)
29+
androidDebugger.attachToClient(project, client)
3030
}
3131

3232
// Disconnect any active run sessions to the same client
3333
private fun terminateRunSessions(selectedClient: Client) {
3434
val pid = selectedClient.clientData.pid
3535

3636
// find if there are any active run sessions to the same client, and terminate them if so
37-
for (handler in ExecutionManager.getInstance(project).runningProcesses) {
37+
for (handler in ExecutionManager.getInstance(project).getRunningProcesses()) {
3838
if (handler is AndroidProcessHandler) {
3939
val client = handler.getClient(selectedClient.device)
4040
if (client != null && client.clientData.pid == pid) {

0 commit comments

Comments
 (0)