From 91f60d4338affd3cefd8701a48b88cae84444f3c Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 29 Sep 2026 11:15:05 +0200 Subject: [PATCH] make mobile debug connexion --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index 2b3ac2a..5fc42df 100644 --- a/Makefile +++ b/Makefile @@ -84,3 +84,19 @@ exec_mysql: dump_db: docker exec leshed-mysql-1 sh -c 'exec mariadb-dump -uroot -pleshed leshed' > ./ressources/leshed-$(DATE_NOW)-local.sql + +# Test sur mobile : connexion ADB sans fil + tunnel vers le serveur Vite (HMR). +# Le port du débogage sans fil change à chaque activation : on le passe +# (make mobile MOBILE=192.168.1.101:37495) ou on le laisse trouver par nmap. +# L'appareil doit avoir été associé une fois (adb pair IP:PORT CODE). +MOBILE ?= 192.168.1.101 + +mobile: + @target="$(MOBILE)"; \ + case "$$target" in *:*) ;; *) \ + port=$$(nmap -Pn -p 30000-50000 --min-rate 3000 -T4 "$$target" | awk -F/ '/open/ {print $$1; exit}'); \ + [ -n "$$port" ] || { echo "Aucun port ADB trouvé sur $$target (débogage sans fil actif ?)"; exit 1; }; \ + target="$$target:$$port";; \ + esac; \ + adb connect "$$target" && adb -s "$$target" reverse tcp:5173 tcp:5173 && \ + echo "OK : $$target, localhost:5173 du mobile -> Vite du laptop. Firefox : about:debugging"