diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..bf0826a
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+scrcpy
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 13a8247..dd09283 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,14 +4,16 @@
diff --git a/.idea/runConfigurations/buildPlugin.xml b/.idea/runConfigurations/buildPlugin.xml
new file mode 100644
index 0000000..770f5c2
--- /dev/null
+++ b/.idea/runConfigurations/buildPlugin.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/runIde.xml b/.idea/runConfigurations/runIde.xml
new file mode 100644
index 0000000..8ed3271
--- /dev/null
+++ b/.idea/runConfigurations/runIde.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 19788a9..4317c84 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
buildscript {
- ext.kotlin_version = '1.4.0'
+ ext.kotlin_version = '1.4.10'
repositories {
mavenCentral()
@@ -31,17 +31,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
}
}
group "com.codertainment"
-version "0.1.2"
+version "0.1.3"
intellij {
pluginName 'Scrcpy Controller'
updateSinceUntilBuild false
- version 'IU-2020.2.1'
+ version 'IU-2020.2.3'
//intellij.localPath = project.hasProperty("StudioRunPath") ? StudioRunPath : StudioCompilePath
}
patchPluginXml {
changeNotes """
+ v0.1.3: Add option to set adb path (use only if scrcpy can't detect ADB Path) (maybe necessary for macOS)
v0.1.2: Really fix shortcut MOD setting not working (this time I've tested it :P)
v0.1.1: Fix Shortcut MOD setting not working
v0.1.0:
diff --git a/src/main/kotlin/com/codertainment/scrcpy/controller/model/ScrcpyProps.kt b/src/main/kotlin/com/codertainment/scrcpy/controller/model/ScrcpyProps.kt
index e72c661..bfa6763 100644
--- a/src/main/kotlin/com/codertainment/scrcpy/controller/model/ScrcpyProps.kt
+++ b/src/main/kotlin/com/codertainment/scrcpy/controller/model/ScrcpyProps.kt
@@ -15,6 +15,7 @@ import java.io.File
@State(name = "com.codertainment.scrcpy.controller.model.ScrcpyProps", storages = [Storage("ScrcpyProps.xml")])
data class ScrcpyProps(
var scrcpyPath: String? = null,
+ var adbPath: String? = null,
//adb
var ip1: Int? = 192, var ip2: Int? = 168, var ip3: Int? = null, var ip4: Int? = null, var port: Int? = 5555,
@@ -84,14 +85,7 @@ data class ScrcpyProps(
val isIpValid get() = ip1 != null && ip2 != null && ip3 != null && ip4 != null && port != null
val ip get() = listOf(ip1, ip2, ip3, ip4).joinToString(".")
- fun pathTestCommand() = arrayListOf().apply {
- if (scrcpyPath != null) {
- add(scrcpyPath + File.separator + "scrcpy")
- } else {
- add("scrcpy")
- }
- add("-v")
- }
+ fun adbPath() = adbPath ?: "adb"
fun buildCommand(serial: String) = arrayListOf().apply {
if (scrcpyPath != null) {
diff --git a/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyController.kt b/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyController.kt
index 7de9977..dffc95b 100644
--- a/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyController.kt
+++ b/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyController.kt
@@ -141,7 +141,7 @@ internal class ScrcpyController(private val toolWindow: ToolWindow) : DeviceDete
try {
selectedDevices.iterator().forEach {
if (!commandExecutors.containsKey(it)) {
- val cmd = CommandExecutor(props.buildCommand(it)) { exit, msg, fullOp, ioe ->
+ val cmd = CommandExecutor(props.buildCommand(it), adbPath = props.adbPath) { exit, msg, fullOp, ioe ->
exit?.let { _ ->
commandExecutors.remove(it)
println("Exited: $exit")
@@ -380,7 +380,7 @@ internal class ScrcpyController(private val toolWindow: ToolWindow) : DeviceDete
toWifi.forEach { serial ->
runInBg {
try {
- CommandExecutor(listOf("adb", "-s", serial, "tcpip", props.port?.toString() ?: "5555")) { exitCode, _, fullOp, _ ->
+ CommandExecutor(listOf(props.adbPath(), "-s", serial, "tcpip", props.port?.toString() ?: "5555")) { exitCode, _, fullOp, _ ->
exitCode?.let {
if (it != 0) {
Notifier.notify(
@@ -391,7 +391,7 @@ internal class ScrcpyController(private val toolWindow: ToolWindow) : DeviceDete
)
} else {
Thread.sleep(1500)
- CommandExecutor(listOf("adb", "-s", serial, "shell", "ip -f inet addr show wlan0")) { exitCode, _, fullOp, _ ->
+ CommandExecutor(listOf(props.adbPath(), "-s", serial, "shell", "ip -f inet addr show wlan0")) { exitCode, _, fullOp, _ ->
exitCode?.let {
if (it == 0 && fullOp != null) {
val ip = fullOp.split("inet ")[1].split("/")[0]
diff --git a/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyControllerSettingsComponent.form b/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyControllerSettingsComponent.form
index ba17128..2228596 100644
--- a/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyControllerSettingsComponent.form
+++ b/src/main/kotlin/com/codertainment/scrcpy/controller/ui/ScrcpyControllerSettingsComponent.form
@@ -1,9 +1,9 @@