Repository: alttester/AltTester-Unity-SDK (language: python)

Issue:
Validations for port and host from the AltUnityDialog don't work
https://gitlab.com/altom/altunity/altunitytester/-/merge_requests/754#note_1109971281 - also this issues

---
<sub>You can find the original issue from GitLab [here](https://gitlab.com/altom/altunity/altunitytester/-/issues/927).</sub>



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 144092ef7..556bc9af0 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -1,8 +1,6 @@
 name: Push
-on:
-  push:
-  workflow_dispatch:
 
+on: [push, workflow_dispatch]
 
 jobs:
   build-docs:
@@ -42,9 +40,7 @@ jobs:
             export PROXY_PORT=13010
             export PROXY_HOST="127.0.0.1"
             $UNITY_2021_3_HOME -batchmode -stackTraceLogType None -projectPath $CI_PROJECT_DIR -executeMethod Altom.AltTesterTools.BuildAltTester.MacBuildFromCommandLine -logFile buildMac.log -quit
-          
 
-        - run: ls
         - uses: actions/upload-artifact@v3.1.0
           if: always() # run this step even if one of the previous step failed
           with:
@@ -62,13 +58,18 @@ jobs:
         with:
           name:
             BuildMacArtifact
+
       - run: |
-          chmod -R 755  sampleGame.app
+          export PROXY_PORT=13010
+          export PROXY_HOST="127.0.0.1"
+          chmod -R 755 sampleGame.app
           open sampleGame.app
+
+      - run: |
           export PROXY_PORT=13010
-          echo $PROXY_PORT
           export PROXY_HOST="127.0.0.1"
           $UNITY_2021_3_HOME -batchmode -stackTraceLogType None -projectPath $CI_PROJECT_DIR -executeMethod Altom.AltTesterEditor.AltTestRunner.RunTestFromCommandLine -testsAssembly Assembly-CSharp-Editor  -logFile csharpAndroidTests.log -quit
+
       #TODO add back -reportPath $CI_PROJECT_DIR/reportTest.xml for removing because it's giving me unauthorized error
       - uses: actions/upload-artifact@v3.1.0
         if: always() # run this step even if one of the previous step failed
@@ -77,7 +78,7 @@ jobs:
           path: |
             *.log
             reportTest.xml
-            
+
   test-DotNet:
       runs-on: [self-hosted, macOS]
       needs: build-macOS
@@ -85,7 +86,7 @@ jobs:
         - uses: actions/checkout@v3
         - uses: actions/download-artifact@v3.0.0
           with:
-            name: 
+            name:
               BuildMacArtifact
         - name: Setup .NET Core SDK
           uses: actions/setup-dotnet@v2.1.1
@@ -103,62 +104,56 @@ jobs:
             name: TestCSharpArtifact
             path: |
               *.log
-  
-  test-Python:
-      runs-on: [self-hosted, macOS]
-      needs: build-macOS
-      steps:
-        - uses: actions/checkout@v3
 
-        - uses: actions/download-artifact@v3.0.0
-          with:
-            name:
-              BuildMacArtifact
+  test-Python:
+    runs-on: [self-hosted, macOS]
+    needs: build-macOS
+    steps:
+      - uses: actions/checkout@v3
 
-        - uses: actions/setup-python@v4
-          with:
-            python-version: '3.10'
-            cached: 'pip'
+      - uses: actions/download-artifact@v3.0.0
+        with:
+          name:
+            BuildMacArtifact
 
-        - uses: syphar/restore-virtualenv@v1
-          id: cache-virtualenv
+      - name: Open application
+        run: |
+          export PROXY_PORT=13010
+          export PROXY_HOST="127.0.0.1"
+          chmod -R 755 sampleGame.app
+          open sampleGame.app
 
-        - uses: syphar/restore-pip-download-cache@v1
-          if: steps.cache-virtualenv.outputs.cache-hit != 'true'
-        - name: Open Application
-          run: |
-            export PROXY_PORT=13010
-            export PROXY_HOST="127.0.0.1"
-            echo $PROXY_PORT
-            chmod -R 755 sampleGame.app
-            open sampleGame.app
+      - uses: actions/setup-python@v4
+        with:
+          python-version: '3.10'
 
-        - name: Install dependencies
-          run: |
-            pip install -r "Bindings~/python/requirements.txt"
-            pip install -r "Bindings~/python/requirements-dev.txt"
-            pip install -e "Bindings~/python" --root "Bindings~/python"
+      - name: Install dependencies
+        run: |
+          pip install --upgrade pip setuptools wheel
+          pip uninstall AltTester-Driver
+          pip install -r "Bindings~/python/requirements.txt"
+          pip install -r "Bindings~/python/requirements-dev.txt"
+          pip install -e "Bindings~/python" --root "Bindings~/python"
 
-        - name: Lint with flake8
-          run: |
-            flake8 Bindings~/python/tests --config Bindings~/python/.flake8
+      - name: Lint with flake8
+        run: |
+          flake8 Bindings~/python/ --config Bindings~/python/.flake8
 
-        - name: Run unit tests
-          run: |
-            pytest Bindings~/python/tests/unit
+      - name: Run unit tests
+        run: |
+          pytest Bindings~/python/tests/unit
 
-        - name: Run integration tests
-          run: |
-            export PROXY_PORT=13010
-            export PROXY_HOST="127.0.0.1"
-            pytest Bindings~/python/tests/integration
+      - name: Run integration tests
+        run: |
+          export PROXY_PORT=13010
+          export PROXY_HOST="127.0.0.1"
+          pytest Bindings~/python/tests/integration
 
-        - uses: actions/upload-artifact@v3.1.0
-          if: always() # run this step even if one of the previous step failed
-          with:
-            name: TestPythonArtifact
-            path: |
-              *.log
+      - uses: actions/upload-artifact@v3.1.0
+        if: always() # run this step even if one of the previous step failed
+        with:
+          name: TestPythonArtifact
+          path: "**/*.log"
 
   test-Java:
       runs-on: [self-hosted, macOS]
@@ -167,9 +162,9 @@ jobs:
         - uses: actions/checkout@v3
         - uses: actions/download-artifact@v3.0.0
           with:
-            name: 
+            name:
               BuildMacArtifact
-              
+
         - name: Setup Java JDK
           uses: actions/setup-java@v3.5.1
           with:
@@ -191,7 +186,7 @@ jobs:
             name: TestJavaArtifact
             path: |
               *.log
-              
+
   dev-docs:
     runs-on: [self-hosted, macOS]
     needs: build-docs
diff --git a/Assets/AltTester/AltServer/Communication/AltResponseQueue.cs b/Assets/AltTester/AltServer/Communication/AltResponseQueue.cs
index 96bfeaef3..a8584beb9 100644
--- a/Assets/AltTester/AltServer/Communication/AltResponseQueue.cs
+++ b/Assets/AltTester/AltServer/Communication/AltResponseQueue.cs
@@ -12,6 +12,7 @@ public class AltResponseQueue
         public void Cycle()
         {
             if (responseQueue.Count == 0) return;
+
             lock (queueLock)
             {
                 if (responseQueue.Count > 0)
@@ -31,7 +32,12 @@ public void ScheduleResponse(SendResponse newResponse)
                 }
             }
         }
+
+        public void Clear() {
+            lock (queueLock)
+            {
+                responseQueue.Clear();
+            }
+        }
     }
 }
-
-
diff --git a/Assets/AltTester/AltServer/UI/AltDialog.cs b/Assets/AltTester/AltServer/UI/AltDialog.cs
index 08446ab8b..3a74f75cd 100644
--- a/Assets/AltTester/AltServer/UI/AltDialog.cs
+++ b/Assets/AltTester/AltServer/UI/AltDialog.cs
@@ -40,27 +40,25 @@ public class AltDialog : UnityEngine.MonoBehaviour
         [UnityEngine.SerializeField]
         public UnityEngine.UI.Button RestartButton = null;
 
-        private ICommunication communication;
-
         public AltInstrumentationSettings InstrumentationSettings { get { return AltRunner._altRunner.InstrumentationSettings; } }
 
+        private ICommunication communication;
         private readonly AltResponseQueue _updateQueue = new AltResponseQueue();
         private bool wasConnectedBeforeToProxy = false;
 
         protected void Start()
         {
+            Dialog.SetActive(InstrumentationSettings.ShowPopUp);
+
+            SetTitle("AltTester v." + AltRunner.VERSION);
+            SetUpCloseButton();
+            setUpIcon();
             SetUpHostInputField();
             SetUpPortInputField();
             SetUpGameNameInputField();
-
             SetUpRestartButton();
 
-            Dialog.SetActive(InstrumentationSettings.ShowPopUp);
-            CloseButton.onClick.AddListener(ToggleDialog);
-            Icon.GetComponent<UnityEngine.UI.Button>().onClick.AddListener(ToggleDialog);
-            TitleText.text = "AltTester v." + AltRunner.VERSION;
-
-            StartAltTester();
+            StartClient();
         }
 
         protected void Update()
@@ -70,10 +68,34 @@ protected void Update()
 
         protected void OnApplicationQuit()
         {
-            cleanUp();
+            StopClient();
+        }
+
+        private void SetMessage(string message, UnityEngine.Color color, bool visible)
+        {
+            Dialog.SetActive(visible);
+            Dialog.GetComponent<UnityEngine.UI.Image>().color = color;
+            MessageText.text = message;
         }
 
-        public void OnPortInputFieldValueChange(string value)
+        private void SetTitle(string title) {
+            TitleText.text = title;
+        }
+
+        private void ToggleDialog()
+        {
+            Dialog.SetActive(!Dialog.activeSelf);
+        }
+
+        private void SetUpCloseButton() {
+            CloseButton.onClick.AddListener(ToggleDialog);
+        }
+
+        private void setUpIcon() {
+            Icon.GetComponent<UnityEngine.UI.Button>().onClick.AddListener(ToggleDialog);
+        }
+
+        private void OnPortInputFieldValueChange(string value)
         {
             // Allow only positive numbers.
             if (value == "-")
@@ -82,26 +104,27 @@ public void OnPortInputFieldValueChange(string value)
             }
         }
 
-        public void SetUpHostInputField()
+        private void SetUpHostInputField()
         {
             HostInputField.text = InstrumentationSettings.ProxyHost;
         }
 
-        public void SetUpPortInputField()
+        private void SetUpPortInputField()
         {
             PortInputField.text = InstrumentationSettings.ProxyPort.ToString();
             PortInputField.onValueChanged.AddListener(OnPortInputFieldValueChange);
             PortInputField.characterValidation = UnityEngine.UI.InputField.CharacterValidation.Integer;
         }
 
-        public void SetUpGameNameInputField()
+        private void SetUpGameNameInputField()
         {
             GameNameInputField.text = InstrumentationSettings.GameName;
         }
 
         private void OnRestartButtonPress()
         {
-            logger.Debug("Restart the AltTester.");
+            logger.Debug("Restart the AltTester client.");
+            StopClient();
 
             if (Uri.CheckHostName(HostInputField.text) != UriHostNameType.Unknown)
             {
@@ -109,7 +132,7 @@ private void OnRestartButtonPress()
             }
             else
             {
-                setDialog("The host should be a valid host.", ERROR_COLOR, true);
+                SetMessage("The host should be a valid host.", ERROR_COLOR, true);
                 return;
             }
 
@@ -120,18 +143,28 @@ private void OnRestartButtonPress()
             }
             else
             {
-                setDialog("The port number should be beteween 1 and 65535.", ERROR_COLOR, true);
+                SetMessage("The port number should be beteween 1 and 65535.", ERROR_COLOR, true);
+                return;
+            }
+
+            if (!string.IsNullOrEmpty(GameNameInputField.text))
+            {
+                InstrumentationSettings.GameName = GameNameInputField.text;
+            }
+            else
+            {
+                SetMessage("Game name should not be empty.", ERROR_COLOR, true);
                 return;
             }
 
             try
             {
-                RestartAltTester();
+                StartClient();
             }
             catch (Exception ex)
             {
-                setDialog("An unexpected error occurred while restarting the AltTester.", ERROR_COLOR, true);
-                logger.Error("An unexpected error occurred while restarting the AltTester.");
+                SetMessage("An unexpected error occurred while restarting the AltTester client.", ERROR_COLOR, true);
+                logger.Error("An unexpected error occurred while restarting the AltTester client.");
                 logger.Error(ex.GetType().ToString(), ex.Message);
             }
         }
@@ -141,57 +174,24 @@ public void SetUpRestartButton()
             RestartButton.onClick.AddListener(OnRestartButtonPress);
         }
 
-        public void ToggleDialog()
-        {
-            Dialog.SetActive(!Dialog.activeSelf);
-        }
-
-        private void setDialog(string message, UnityEngine.Color color, bool visible)
-        {
-            Dialog.SetActive(visible);
-            MessageText.text = message;
-            Dialog.GetComponent<UnityEngine.UI.Image>().color = color;
-        }
-
-        private void StartAltTester()
-        {
-            startProxyCommProtocol();
-        }
-
-        private void StopAltTester()
-        {
-            logger.Debug("Stopping AltTester.");
-            if (communication != null)
-            {
-                communication.Stop();
-            }
-        }
-
-        private void RestartAltTester()
-        {
-            StopAltTester();
-            StartAltTester();
-        }
-
-        #region proxy mode comm protocol
-
-        private void initProxyCommProtocol()
+        private void InitClient()
         {
             var cmdHandler = new CommandHandler();
 
-#if UNITY_WEBGL && !UNITY_EDITOR
-            communication = new WebSocketWebGLCommunication(cmdHandler, InstrumentationSettings.ProxyHost, InstrumentationSettings.ProxyPort);
-#else
-            communication = new WebSocketClientCommunication(cmdHandler, InstrumentationSettings.ProxyHost, InstrumentationSettings.ProxyPort, InstrumentationSettings.GameName);
-#endif
-            communication.OnConnect += onProxyConnect;
-            communication.OnDisconnect += onProxyDisconnect;
-            communication.OnError += onError;
+            #if UNITY_WEBGL && !UNITY_EDITOR
+                communication = new WebSocketWebGLCommunication(cmdHandler, InstrumentationSettings.ProxyHost, InstrumentationSettings.ProxyPort);
+            #else
+                communication = new WebSocketClientCommunication(cmdHandler, InstrumentationSettings.ProxyHost, InstrumentationSettings.ProxyPort, InstrumentationSettings.GameName);
+            #endif
+
+            communication.OnConnect += OnConnect;
+            communication.OnDisconnect += OnDisconnect;
+            communication.OnError += OnError;
         }
 
-        private void startProxyCommProtocol()
+        private void StartClient()
         {
-            initProxyCommProtocol();
+            InitClient();
 
             try
             {
@@ -200,78 +200,88 @@ private void startProxyCommProtocol()
                     communication.Start();
                 }
                 if (!communication.IsConnected) // display dialog only if not connected
-                    onStart();
+                {
+                    OnStart();
+                }
             }
             catch (UnhandledStartCommError ex)
             {
-                setDialog("An unexpected error occurred while starting the communication protocol.", ERROR_COLOR, true);
+                SetMessage("An unexpected error occurred while starting the communication protocol.", ERROR_COLOR, true);
                 logger.Error(ex.InnerException, "An unexpected error occurred while starting the communication protocol.");
             }
             catch (Exception ex)
             {
-                setDialog("An unexpected error occurred while starting the communication protocol.", ERROR_COLOR, true);
+                SetMessage("An unexpected error occurred while starting the communication protocol.", ERROR_COLOR, true);
                 logger.Error(ex, "An unexpected error occurred while starting the communication protocol.");
             }
         }
 
-        private void onStart()
+        private void StopClient()
+        {
+            _updateQueue.Clear();
+
+            if (communication != null)
+            {
+                communication.Stop();
+
+                communication.OnConnect = null;
+                communication.OnDisconnect = null;
+                communication.OnError = null;
+            }
+        }
+
+        private void OnStart()
         {
-            setDialog("Connected to AltProxy on " + InstrumentationSettings.ProxyHost + ":" + InstrumentationSettings.ProxyPort + " with game name " + InstrumentationSettings.GameName, SUCCESS_COLOR, Dialog.activeSelf || wasConnectedBeforeToProxy);
+            string message = String.Format("Waiting to connect to AltProxy on {0}:{1} with game name: '{2}'.", InstrumentationSettings.ProxyHost, InstrumentationSettings.ProxyPort, InstrumentationSettings.GameName);
+            SetMessage(message, SUCCESS_COLOR, Dialog.activeSelf || wasConnectedBeforeToProxy);
             wasConnectedBeforeToProxy = false;
         }
 
-        private void onProxyConnect()
+        private void OnConnect()
         {
-            string message = "Connected to AltProxy on " + InstrumentationSettings.ProxyHost + ":" + InstrumentationSettings.ProxyPort + " with game name " + InstrumentationSettings.GameName;
-#if ALTTESTER && ENABLE_LEGACY_INPUT_MANAGER
-            Input.UseCustomInput = true;
-            UnityEngine.Debug.Log("Custom input: " + Input.UseCustomInput);
-#endif
+            string message = String.Format("Connected to AltProxy on {0}:{1} with game name: '{2}'.", InstrumentationSettings.ProxyHost, InstrumentationSettings.ProxyPort, InstrumentationSettings.GameName);
+
+            #if ALTTESTER && ENABLE_LEGACY_INPUT_MANAGER
+                Input.UseCustomInput = true;
+                UnityEngine.Debug.Log("Custom input: " + Input.UseCustomInput);
+            #endif
+
             _updateQueue.ScheduleResponse(() =>
             {
-#if ALTTESTER && ENABLE_INPUT_SYSTEM
-                NewInputSystem.DisableDefaultDevicesAndEnableAltDevices();
-#endif
-                setDialog(message, SUCCESS_COLOR, false);
+                #if ALTTESTER && ENABLE_INPUT_SYSTEM
+                    NewInputSystem.DisableDefaultDevicesAndEnableAltDevices();
+                #endif
+
+                SetMessage(message, SUCCESS_COLOR, false);
                 wasConnectedBeforeToProxy = true;
             });
         }
 
-        private void onProxyDisconnect()
+        private void OnDisconnect()
         {
-#if ALTTESTER && ENABLE_LEGACY_INPUT_MANAGER
-            Input.UseCustomInput = false;
-            UnityEngine.Debug.Log("Custom input: " + Input.UseCustomInput);
-#endif
+            #if ALTTESTER && ENABLE_LEGACY_INPUT_MANAGER
+                Input.UseCustomInput = false;
+                UnityEngine.Debug.Log("Custom input: " + Input.UseCustomInput);
+            #endif
+
             _updateQueue.ScheduleResponse(() =>
             {
-#if ALTTESTER && ENABLE_INPUT_SYSTEM
-                NewInputSystem.EnableDefaultDevicesAndDisableAltDevices();
-
-#endif
-                startProxyCommProtocol();
+                #if ALTTESTER && ENABLE_INPUT_SYSTEM
+                    NewInputSystem.EnableDefaultDevicesAndDisableAltDevices();
+                #endif
 
+                StartClient();
             });
         }
 
-        #endregion
-
-        private void onError(string message, Exception ex)
+        private void OnError(string message, Exception ex)
         {
             logger.Error(message);
+
             if (ex != null)
             {
                 logger.Error(ex);
             }
         }
-
-        private void cleanUp()
-        {
-            logger.Debug("Stopping communication protocol");
-            if (communication != null)
-            {
-                communication.Stop();
-            }
-        }
     }
-}
\ No newline at end of file
+}
diff --git a/Bindings~/dotnet/AltDriver.Tests/unit/TestAltPortForwarding.cs b/Bindings~/dotnet/AltDriver.Tests/unit/TestAltPortForwarding.cs
deleted file mode 100644
index a68576ba4..000000000
--- a/Bindings~/dotnet/AltDriver.Tests/unit/TestAltPortForwarding.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-using System;
-using System.IO;
-using NUnit.Framework;
-
-namespace Altom.AltDriver.Tests
-{
-    [Timeout(10000)]
-    [Category("Android")]
-    public class TestAltPortForwarding
-    {
-        private string androidSdkRoot;
-        [OneTimeSetUp]
-        public void OneTimeSetUp()
-        {
-            //store ANDROID_SDK_ROOT original
-            androidSdkRoot = Environment.GetEnvironmentVariable("ANDROID_SDK_ROOT");
-        }
-        [OneTimeTearDown]
-        public void OneTimeTearDown()
-        {
-            //restore ANDROID_SDK_ROOT to original
-            Environment.SetEnvironmentVariable("ANDROID_SDK_ROOT", androidSdkRoot);
-            AltPortForwarding.ForwardAndroid();
-        }
-        [SetUp]
-        public void SetUp()
-        {
-            AltPortForwarding.RemoveAllForwardAndroid();
-        }
-
-        [TearDown]
-        public void TearDown()
-        {
-            //restore ANDROID_SDK_ROOT to original
-            Environment.SetEnvironmentVariable("ANDROID_SDK_ROOT", androidSdkRoot);
-        }
-
-        [Test]
-        public void TestGetAdbPathOverwrite()
-        {
-            Assert.AreEqual("overwrite", AltPortForwarding.GetAdbPath("overwrite"));
-        }
-
-        [Test]
-        public void TestGetAdbPathAndroidSdk()
-        {
-            var sdkPath = string.Join(Path.DirectorySeparatorChar, "path", "to", "sdk");
-            Environment.SetEnvironmentVariable("ANDROID_SDK_ROOT", sdkPath);
-
-            var expected = string.Join(Path.DirectorySeparatorChar, sdkPath, "platform-tools", "adb");
-            Assert.AreEqual(expected, AltPortForwarding.GetAdbPath(""));
-        }
-        [Test]
-        public void TestGetAdbPathSystemPath()
-        {
-            Environment.SetEnvironmentVariable("ANDROID_SDK_ROOT", null);
-            Assert.AreEqual("adb", AltPortForwarding.GetAdbPath(""));
-        }
-
-        // Since changing the build to run on mac this test will fail TODO Filter this test out on mac
-        // [Test]
-        // public void TestRemoveForwardAndroid()
-        // {
-        //     AltPortForwarding.ForwardAndroid();
-        //     AltPortForwarding.RemoveForwardAndroid(13000);
-        //     try
-        //     {
-        //         var driver = new AltDriver(enableLogging: true, connectTimeout: 2);
-        //         driver.Stop();
-        //     }
-        //     catch (Exception ex)
-        //     {
-        //         Console.WriteLine(ex.ToString());
-        //         Assert.AreEqual("Failed to connect to AltTester on host: 127.0.0.1 port: 13000.", ex.Message);
-        //         return;
-        //     }
-        //     Assert.Fail("Should not be able to connect");
-
-        // }
-
-        [Test]
-        public void TestForwardAndroid()
-        {
-            AltPortForwarding.RemoveAllForwardAndroid();
-            AltPortForwarding.ForwardAndroid();
-            try
-            {
-                var driver = new AltDriver(enableLogging: true, connectTimeout: 2);
-                driver.Stop();
-            }
-            catch
-            {
-                Assert.Fail("ForwardAndroid failed");
-            }
-        }
-    }
-}
diff --git a/Bindings~/python/requirements-dev.txt b/Bindings~/python/requirements-dev.txt
index a1c40065e..a8dbff040 100644
--- a/Bindings~/python/requirements-dev.txt
+++ b/Bindings~/python/requirements-dev.txt
@@ -10,4 +10,3 @@ flake8
 pytest
 pytest-cov
 pytest-repeat
-# appium-python-client


Test patch:
diff --git a/Bindings~/java/src/test/java/com/alttester/TestsHelper.java b/Bindings~/java/src/test/java/com/alttester/TestsHelper.java
index 43194bc70..2ddb7fb68 100644
--- a/Bindings~/java/src/test/java/com/alttester/TestsHelper.java
+++ b/Bindings~/java/src/test/java/com/alttester/TestsHelper.java
@@ -2,8 +2,9 @@
 
 public class TestsHelper {
     public static int GetAltDriverPort() {
-        String port = System.getenv("ALTDRIVER_PORT");
-        if (port != null && port == "") {
+        String port = System.getenv("PROXY_PORT");
+
+        if (port != null && port != "") {
             return Integer.parseInt(port);
         }
 
@@ -11,8 +12,9 @@ public static int GetAltDriverPort() {
     }
 
     public static String GetAltDriverHost() {
-        String host = System.getenv("ALTDRIVER_HOST");
-        if (host != null && host == "") {
+        String host = System.getenv("PROXY_HOST");
+
+        if (host != null && host != "") {
             return host;
         }
 
diff --git a/Bindings~/python/alttester/__init__.py b/Bindings~/python/alttester/__init__.py
index 8f483d199..0f7c7918c 100644
--- a/Bindings~/python/alttester/__init__.py
+++ b/Bindings~/python/alttester/__init__.py
@@ -4,5 +4,4 @@
 from alttester.playerpref import PlayerPrefKeyType
 from alttester.keycode import AltKeyCode
 from alttester.logging import AltLogLevel, AltLogger
-from alttester.portforwarding import AltPortForwarding
 from alttester.exceptions import *
diff --git a/Bindings~/python/alttester/portforwarding.py b/Bindings~/python/alttester/portforwarding.py
deleted file mode 100644
index 826b4b216..000000000
--- a/Bindings~/python/alttester/portforwarding.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import subprocess
-
-from ppadb.client import Client as AdbClient
-
-
-class AltPortForwarding:
-    _client = AdbClient(host="127.0.0.1", port=5037)
-
-    @staticmethod
-    def _get_iproxy_path(iproxy_path):
-        if not iproxy_path:
-            return "iproxy"
-        return iproxy_path
-
-    @classmethod
-    def _get_device(cls, device_id=""):
-        if device_id == "":
-            devices = cls._client.devices()
-            if len(devices) == 0:
-                raise Exception("No device found")
-            return devices[0]
-        else:
-            return cls._client.device(device_id)
-
-    @staticmethod
-    def forward_ios(local_port=13000, device_port=13000, device_id="", iproxy_path=""):
-        process = None
-        iproxy_path = AltPortForwarding._get_iproxy_path(iproxy_path)
-        if device_id == "":
-            process = subprocess.Popen(
-                [iproxy_path, str(local_port), str(device_port)])
-        else:
-            process = subprocess.Popen(
-                [iproxy_path, str(local_port), str(device_port), "-u", device_id])
-        return process.pid
-
-    @staticmethod
-    def kill_iproxy(pid):
-        subprocess.Popen(['kill', str(pid)]).wait()
-
-    @staticmethod
-    def kill_all_iproxy_process():
-        subprocess.Popen(['killall', 'iproxy']).wait()
-
-    @staticmethod
-    def forward_android(local_port=13000, device_port=13000, device_id=""):
-        device = AltPortForwarding._get_device(device_id)
-
-        device.forward("tcp:" + str(local_port), "tcp:" + str(device_port))
-
-    @staticmethod
-    def remove_forward_android(local_port=13000, device_id=""):
-        device = AltPortForwarding._get_device(device_id)
-        device.killforward("tcp:" + str(local_port))
-
-    @staticmethod
-    def remove_all_forward_android():
-        AltPortForwarding._client.killforward_all()