diff --git a/script/todo/todo.py b/script/todo/todo.py index a0a6238..3ede25f 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -5939,7 +5939,14 @@ class TODO: '-d "$dev" --force && ' # Rendu logiciel, écrit dans la config : par ssh -X il n'y a pas de # GLX direct, et « auto » donnerait un écran noir. - 'printf "hw.gpu.enabled=yes\\nhw.gpu.mode=swiftshader_indirect\\n" ' + # L'écran, RÉDUIT, et c'est ce réglage qui décide du confort. Le + # profil Pixel donne 1080x2400, soit 2,6 Mpixels à pousser + # image par image à travers SSH, en rendu logiciel : « ça se + # lance mais c'est trop lent ». En 540x1140 il en reste + # 0,62 Mpixel — 4,2 fois moins. Android gère la densité et + # l'application ne s'en aperçoit pas ; qui veut la taille + # réelle l'écrase au lancement par « -skin 1080x2400 ». + 'printf "hw.gpu.enabled=yes\\nhw.gpu.mode=swiftshader_indirect\\nhw.lcd.width=540\\nhw.lcd.height=1140\\nhw.lcd.density=240\\n" ' ">> $HOME/.android/avd/erplibre.avd/config.ini' && " f'echo " ✅ {t("AVD ready:")} ' "$(cat $HOME/.erplibre-avd-device) / " @@ -5954,7 +5961,11 @@ class TODO: # à ces commandes, et « emulator » y répond « command not # found ». Vécu, sur la ligne que ce message affichait lui-même. f'echo " {t("open it from your workstation:")} ' - 'ssh -X erplibre@$ip \\"$HOME/android/emulator/emulator -avd erplibre -no-audio\\""; ' + # « -XC » et non « -X » : la compression X11 change tout sur un + # écran distant. « -no-boot-anim » retire une animation qui + # ne sert qu'à faire attendre. + 'ssh -XC erplibre@$ip \\"$HOME/android/emulator/emulator ' + '-avd erplibre -no-audio -no-boot-anim\\""; ' f'echo " {t("then install the APK:")} ' # « -t » : l'ABI injectée fait marquer l'APK « testOnly » par AGP, # et adb le refuse sans ce drapeau — « INSTALL_FAILED_TEST_ONLY ». diff --git a/test/test_qemu_desktop_tools.py b/test/test_qemu_desktop_tools.py index e31e268..f6e2bd4 100644 --- a/test/test_qemu_desktop_tools.py +++ b/test/test_qemu_desktop_tools.py @@ -386,6 +386,23 @@ class TestAndroidEmulator(unittest.TestCase): "avd", self.todo._qemu_tools_for(("avd",), "amd64", "", "ubuntu") ) + def test_the_screen_is_small_enough_to_travel(self): + """Le profil Pixel donne 1080x2400 : 2,6 Mpixels par image à pousser + dans SSH, et « ça se lance mais c'est trop lent ». Mesuré après + réduction : 540x1140 confirmé par « wm size », et la capture pleine + page tombe de 220 Ko à 49 Ko.""" + for key in ( + "hw.lcd.width=540", + "hw.lcd.height=1140", + "hw.lcd.density=240", + ): + self.assertIn(key, self.cmd, key) + + def test_the_printed_command_compresses_the_display(self): + """« -XC » plutôt que « -X » sur un écran distant.""" + self.assertIn("ssh -XC erplibre@$ip", self.cmd) + self.assertNotIn("ssh -X erplibre@$ip", self.cmd.replace("-XC", "")) + def test_software_rendering_is_written_into_the_avd(self): """Par « ssh -X » il n'y a pas de GLX direct : en « auto », l'émulateur s'ouvre sur un écran noir. Le réglage va dans config.ini @@ -417,7 +434,7 @@ class TestAndroidEmulator(unittest.TestCase): def test_it_prints_the_command_to_open_it(self): """Un émulateur dont on ignore comment l'ouvrir ne sert à personne.""" - self.assertIn("ssh -X erplibre@$ip", self.cmd) + self.assertIn("ssh -XC erplibre@$ip", self.cmd) self.assertIn("adb install -r", self.cmd) def test_the_printed_commands_use_absolute_paths(self):