make mobile debug connexion
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user