Une fois sdkmanager installé normalement tu dois pouvoir installer une image pour l’émulateur.
Est-ce qu’installer l’application " Whatsapp Web To Go - Whatsapp client for Whatsapp Web " ça t’aiderait ?
Si c’est à moi que tu poses la question, je dirai que non car j’ai l’impression que mon problème est jsute au niveau de la config de la VM. Merci quand meme
Whatsapp client pour whatsapp web n’aide pas pour notre projet directement, mais ca peut etre intéressant à titre individuel pour par exemple partage un compte whatsapp à deux.
@Gyom j’ai pas eu le temps de m’y remettre depuis la dernière fois. Toi tu n’as pas eu de problème avec la version du jdk java, le 8 est recommandé https://packages.debian.org/de/sid/openjdk-8-jdk Tu étais sur debian stretch ou quel autre OS? Sous Yunohost 4 (debian buster) j’ai le jdk 11 et pas moyen de faire tourner java. J’ai essayé ca https://gitlab.com/b8kich/adopt-openjdk-8-jdk/-/blob/master
Lancer une commande sdkmanager
me donne ca:
Warning: Could not create settings
java.lang.IllegalArgumentException
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152)
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
j’ai trouvé ma réponse https://stackoverflow.com/questions/60440509/android-command-line-tools-sdkmanager-always-shows-warning-could-not-create-se
Questions à l’install:
■■■■■■■■■■■■■■:~$ avdmanager create avd -n smartphone -k "system-images;android-28;default;x86"
Auto-selecting single ABI x86===========] 100% Fetch remote repository...
Do you wish to create a custom hardware profile? [no] yes
0: PlayStore: Does the device supports Google Play?
PlayStore.enabled [no]:
1: avd home that was used during the construction of this hardware.ini: This can be used by post processing tools to migrate snapshots
android.avd.home []:
2: sdk root that was used during the construction of this hardware.ini: This can be used by post processing tools to migrate snapshots
android.sdk.root []:
3: ID of the AVD being run:
avd.id [<build>]:
4: Name of the AVD being run:
avd.name [<build>]:
5: Cache partition support: Whether we use a /cache partition on the device.
disk.cachePartition [yes]:
6: Cache partition: Cache partition to use on the device. Ignored if disk.cachePartition is not 'yes'.
disk.cachePartition.path []:
7: Cache partition size:
disk.cachePartition.size [66MB]:
8: Initial data partition: If not empty, its content will be copied to the disk.dataPartition.path file at boot-time.
disk.dataPartition.initPath []:
9: Path to data partition file: Path to data partition file. Cannot be empty. Special value <temp> means using a temporary file. If disk.dataPartition.initPath is not empty, its content will be copied to the disk.dataPartition.path file at boot-time.
disk.dataPartition.path [<temp>]:
10: Ideal size of data partition:
disk.dataPartition.size [0]:
11: Path to encryption key partition file: Path to encryption key partition file. Should be at least 16K bytes empty disk without any filesystem on it.
disk.encryptionKeyPartition.path []:
12: Path to the ramdisk image: Path to the ramdisk image.
disk.ramdisk.path []:
13: Path to snapshot storage: Path to a 'snapshot storage' file, where all snapshots are stored.
disk.snapStorage.path []:
14: Initial system partition image:
disk.systemPartition.initPath []:
15: Path to runtime system partition image:
disk.systemPartition.path []:
16: Ideal size of system partition:
disk.systemPartition.size [0]:
17: Initial vendor partition image:
disk.vendorPartition.initPath []:
18: Path to runtime vendor partition image:
disk.vendorPartition.path []:
19: Ideal size of vendor partition:
disk.vendorPartition.size [0]:
20: Configure setting xml file for Android Window Manager:
display.settings.xml []:
21: Always use cold boot: If set, AVD will always use the full cold boot instead of snapshot-based quick boot process
fastboot.forceColdBoot [no]:
22: Accelerometer: Whether there is an accelerometer in the device.
hw.accelerometer [yes]:
23: Chrome OS device (App Runtime for Chrome): The emulated device is a Chrome OS machine.
hw.arc [no]:
24: Auto login for Chrome OS devices: Used to enable auto login into Chrome OS devices
hw.arc.autologin [no]:
25: Audio recording support: Whether the device can record audio
hw.audioInput [yes]:no
26: Audio playback support: Whether the device can play audio
hw.audioOutput [yes]:no
27: Battery support: Whether the device can run on a battery.
hw.battery [yes]:no
28: Configures camera facing back: Must be 'emulated' for a fake camera, 'webcam<N>' for a web camera, or 'none' if back camera is disabled.
hw.camera.back [emulated]:
29: Configures camera facing front: Must be 'emulated' for a fake camera, 'webcam<N>' for a web camera, or 'none' if front camera is disabled.
hw.camera.front [none]:
30: CPU Architecture: The CPU Architecture to emulator
hw.cpu.arch [arm]:
31: CPU model: The CPU model (QEMU-specific string)
hw.cpu.model []:
32: SMP CPU core count: Number of cores in a simulated SMP CPU.
hw.cpu.ncore [2]:
33: DPad support: Whether the device has DPad keys
hw.dPad [yes]:
34: Screen density of the second display:
hw.display1.density [0]:
35: the flag to use when the second display is initialized in the Android system.:
hw.display1.flag [0]:
36: Pixel height of the second display:
hw.display1.height [0]:
37: Pixel width of the second display:
hw.display1.width [0]:
38: the horizontal offset of the second display with respect to the host QT window.:
hw.display1.xOffset [-1]:
39: the veritcal offset of the second display with respect to the host QT window.:
hw.display1.yOffset [-1]:
40: Screen density of the third display:
hw.display2.density [0]:
41: the flag to use when the third display is initialized in the Android system.:
hw.display2.flag [0]:
42: Pixel height of the third display:
hw.display2.height [0]:
43: Pixel width of the third display:
hw.display2.width [0]:
44: the horizontal offset of the third display with respect to the host QT window.:
hw.display2.xOffset [-1]:
45: the veritcal offset of the third display with respect to the host QT window.:
hw.display2.yOffset [-1]:
46: Screen density of the fourth display:
hw.display3.density [0]:
47: the flag touse when the fourth display is initialized in the Android system.:
hw.display3.flag [0]:
48: Pixel height of the fourth display:
hw.display3.height [0]:
49: Pixel width of the fourth display:
hw.display3.width [0]:
50: the horizontal offset of the fourth display with respect to the host QT window.:
hw.display3.xOffset [-1]:
51: the veritcal offset of the fourth display with respect to the host QT window.:
hw.display3.yOffset [-1]:
52: Vertical size of the sub-region:
hw.displayRegion.0.1.height [0]:
53: Horizontal size of the sub-region:
hw.displayRegion.0.1.width [0]:
54: Horizontal offset of the sub-region:
hw.displayRegion.0.1.xOffset [-1]:
55: Vertical offset of the sub-region:
hw.displayRegion.0.1.yOffset [-1]:
56: Vertical size of the sub-region:
hw.displayRegion.0.2.height [0]:
57: Horizontal size of the sub-region:
hw.displayRegion.0.2.width [0]:
58: Horizontal offset of the sub-region:
hw.displayRegion.0.2.xOffset [-1]:
59: Vertical offset of the sub-region:
hw.displayRegion.0.2.yOffset [-1]:
60: Vertical size of the sub-region:
hw.displayRegion.0.3.height [0]:
61: Horizontal size of the sub-region:
hw.displayRegion.0.3.width [0]:
62: Horizontal offset of the sub-region:
hw.displayRegion.0.3.xOffset [-1]:
63: Vertical offset of the sub-region:
hw.displayRegion.0.3.yOffset [-1]:
64: Feature flags: A comma-separated list of feature flags to enable or disable, such as 'Enabled,-Disabled'.
hw.featureflags []:
65: Transport used to run graphics:
hw.gltransport [pipe]:
66: For address space graphics, the size of the ring used to transfer larger buffers.:
hw.gltransport.asg.dataRingSize [32768]:
67: For address space graphics, the total size of the write buffer the guest can write into:
hw.gltransport.asg.writeBufferSize [1048576]:
68: For address space graphics, the max size of each guest-to-host transaction.:
hw.gltransport.asg.writeStepSize [4096]:
69: Interval over which to flush draw calls (balance host gpu starve vs pipe notif overhead):
hw.gltransport.drawFlushInterval [800]:
70: GPS support: Whether there is a GPS in the device.
hw.gps [yes]:
71: GPU emulation: Enable/Disable emulated OpenGLES GPU
hw.gpu.enabled [no]:
72: GPU emulation mode: This value determines how GPU emulation is implemented.
hw.gpu.mode [auto]:
73: GSM modem support: Whether there is a GSM modem in the device.
hw.gsmModem [yes]:
74: Gyroscope: Whether there is a gyroscope in the device.
hw.gyroscope [yes]:
75: Initial screen orientation: Setup initial screen orientation, can be rotated later on.
hw.initialOrientation [portrait]:
76: Keyboard support: Whether the device has a QWERTY keyboard.
hw.keyboard [no]:
77: Keyboard charmap name: Name of the system keyboard charmap file.
hw.keyboard.charmap [qwerty2]:
78: Keyboard lid support: Whether the QWERTY keyboard can be opened/closed.
hw.keyboard.lid [yes]:
79: LCD backlight: Enable/Disable LCD backlight simulation,yes-enabled,no-disabled.
hw.lcd.backlight [yes]:
80: Abstracted LCD density: A value used to roughly describe the density of the LCD screen for automatic resource/asset selection.
hw.lcd.density [160]:
81: LCD color depth: Color bit depth of emulated framebuffer.
hw.lcd.depth [16]:
82: LCD pixel height:
hw.lcd.height [640]:
83: LCD VSYNC rate:
hw.lcd.vsync [60]:
84: LCD pixel width:
hw.lcd.width [320]:
85: Logcat Output File Path:
hw.logcatOutput.path []:
86: Hardware Back/Home keys: Whether there are hardware back/home keys on the device.
hw.mainKeys [yes]:
87: Device ram size: The amount of physical RAM on the device, in megabytes.
hw.ramSize [0]:
88: Rotary input support: Whether the device has rotary input
hw.rotaryInput [no]:
89: Touch screen type: Defines type of the screen.
hw.screen [multi-touch]:
90: SD Card support: Whether the device supports insertion/removal of virtual SD Cards.
hw.sdCard [yes]:
91: SD Card image path:
hw.sdCard.path []:
92: Enalbe hinge angle sensor.:
hw.sensor.hinge [yes]:
93: hinge areas on the display, format is percentage_of_screen-width, e.g., 33.3-0, 66.6-10 for two sensors. Or x-y-width-height, e.g., 600-0-0-1200, 1200-0-10-1200 for two sensors.:
hw.sensor.hinge.areas []:
94: Provides hinge angle sensor count.:
hw.sensor.hinge.count [0]:
95: default angel for each hinge sensor, e.g., 180, 90 for two sensors.:
hw.sensor.hinge.defaults []:
96: set folded status at a certain posture, e.g, fold-out device, posture flipped:
hw.sensor.hinge.fold_to_displayRegion.0.1_at_posture [1]:
97: angel ranges for each hinge sensor, e.g., 0-360, 0-180 for two sensors.:
hw.sensor.hinge.ranges []:
98: Provides hinge angle sensor sub type. 0 (invisible hinge, fold on screen) and 1 (hinge):
hw.sensor.hinge.sub_type [0]:
99: Provides hinge angle sensor type. 0 (horizontal) and 1 (vertical):
hw.sensor.hinge.type [0]:
100: angles ranges for each posture in posture_list.:
hw.sensor.hinge_angles_posture_definitions []:
101: list of supported postures by index. 0: unknown, 1: closed, 2: half-open, 3: open, 4: flipped, 5: tent:
hw.sensor.posture_list []:
102: Enalbe rollable sensor.:
hw.sensor.roll [no]:
103: rollable sensor count.:
hw.sensor.roll.count [0]:
104: defaults percentage of display width or height which is rolled.:
hw.sensor.roll.defaults []:
105: rolling direction starting from open posture. 0: left-to-right or top-to-buttom, 1: right-to-left or bottom-to-top:
hw.sensor.roll.direction []:
106: roll radious of display width or height.:
hw.sensor.roll.radius []:
107: the pecentage of display width or height which is rollable.:
hw.sensor.roll.ranges []:
108: resize default display to display region 0.1 when rolling to a posture state:
hw.sensor.roll.resize_to_displayRegion.0.1_at_posture [6]:
109: resize default display to display region 0.2 when rolling to a posture state:
hw.sensor.roll.resize_to_displayRegion.0.2_at_posture [6]:
110: resize default display to display region 0.3 when rolling to a posture state:
hw.sensor.roll.resize_to_displayRegion.0.3_at_posture [6]:
111: angles ranges for each posture in posture_list.:
hw.sensor.roll_percentages_posture_definitions []:
112: Uncalibrated gyroscope support: Provides uncalibrated gyroscope sensor values.
hw.sensors.gyroscope_uncalibrated [yes]:
113: Humidity support: Whether there is a relative humidity sensor in the device
hw.sensors.humidity [yes]:
114: Light support: Whether there is a light sensor in the device
hw.sensors.light [yes]:
115: Magnetic field support: Provides magnetic field sensor values.
hw.sensors.magnetic_field [yes]:
116: Uncalibrated magnetic field suport: Provides uncalibrated magnetic field sensor values.
hw.sensors.magnetic_field_uncalibrated [yes]:
117: Orientation support: Provides orientation sensor values.
hw.sensors.orientation [yes]:
118: Pressure support: Whether there is a pressure sensor in the device
hw.sensors.pressure [yes]:
119: Proximity support: Whether there is an proximity in the device.
hw.sensors.proximity [yes]:
120: Temperature support: Provides temperature sensor values.
hw.sensors.temperature [yes]:
121: Track-ball support: Whether there is a trackball on the device.
hw.trackBall [yes]:
122: Deprecated option. Ignored.: Used to specify the Ext4 partition image type. This is now autodetected.
hw.useext4 [yes]:
123: Does the kernel require a new device naming scheme?: Used to specify whether the kernel requires a new device naming scheme. Typically for Linux 3.10 and above.
kernel.newDeviceNaming [autodetect]:
124: kernel boot parameters string.:
kernel.parameters []:
125: Path to the kernel image: Path to the kernel image.
kernel.path []:
126: Does the kernel supports YAFFS2 partitions?: Used to specify whether the kernel supports YAFFS2 partition images. Typically before 3.10 only.
kernel.supportsYaffs2 [autodetect]:
127: Delay sending data to guest adb until guest completed booting:
test.delayAdbTillBootComplete [0]:
128: Monitor Adb messages between guest and host. Default: Disabled.:
test.monitorAdb [0]:
129: Quit emulator after guest boots completely, or after time out. Default: end of universe.:
test.quitAfterBootTimeOut [-1]:
130: Max VM application heap size: The maximum heap size a Dalvik application might allocate before being killed by the system. Value is in megabytes.
vm.heapSize [0]:
@Gyom a priori je suis pret pour tester la mise en prod du setup. Il faudrait juste qu’on se capte pour :
- que tu setup le compte whatsapp avec la SIM ARN => je t’envoie le numéro ARN en MP.
- que je setup le bridge et que tu lui donnes à manger le QR code whatsapp-web à manger
- que tu m’envoies la VM android pour que je la déploie sur mon debian 10
- qu’on vérifie que le bridge arrive à se connecter via whatsapp web
- Il faudra qu’on réfléchisse à la sécurisation du setup définitif (chiffrement de la VM android?)
On pourrait faire ca ce soir?
Hello désolé je n’étais pas trop dispo.
Mais la en soirée ca devrait aller.
On peut partir d’une VM android propre ca ira plus vite je pense. Parce qu’il me semble qu’il ne faut pas que l’application interrompe une fois qu’on a scanné le qr-code
Faut juste qu’on récupere l’apk Whatsapp
Hello,
Je suis aussi plutot dispo On peut faire ca après la présentation de la monnaie libre vendredi. Je ne connais pas encore l’horaire exact. Effectivement si tu me files un coup de main on pourrait déployer directement sur le serveur de test sans avoir à « transplanter » la VM.
Je m’étais arreté aux questions infinies posées à l’install:
avdmanager create avd -n smartphone -k "system-images;android-28;default;x86"
cd /opt/androidsdk/
./emulator/emulator -avd smartphone -webcam-list
me donne:
emulator: ERROR: _camera_device_open: Cannot open camera device '/dev/video0': Permission denied
Et
./emulator/emulator -show-kernel -no-boot-anim -avd smartphone -camera-back webcam0
donne
emulator: ERROR: x86 emulation currently requires hardware acceleration!
CPU acceleration status: /dev/kvm is not found: VT disabled in BIOS or KVM kernel module not loaded
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.
Ah oui il est pas très sympa avec toi
Est-ce que tu as une « vraie » caméra déjà branchée ? Et en créant avant la caméra « virtuelle » ?
J’ai lu que tu peux aussi tester :
sudo chmod 777 /dev/video0
Pour le deuxième point, l’url dans le message d’erreur indique que tu peux verifier que kvm est installé grace à :
$ sudo apt-get install cpu-checker
$ egrep -c '(vmx|svm)' /proc/cpuinfo
12
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
Sinon tu n’auras plus qu’a installer kvm… perso je n’avais pas eu tout ses problèmes mais comme je l’ai fait sur ma machine j’avais sans doute déjà des trucs configurés (qemu, etc… )
Courage
Hello, merci pour les idées. J’essaierai ca samedi aprèm pendant notre hackathon. Si tu pouvais passer ce serait top pour qu’on finisse ca ensemble une bonne fois pour toutes
Si tu as une autre dispo un soir je suis preneur aussi.
A+!
Il y a un hackathon samedi ?
Ouai on remplace le libérons-nous du pistage s’il n’y a pas grand monde.
Bon, après sudo apt-get install --no-install-recommends qemu-system
(https://wiki.debian.org/KVM) j’obtiens
INFO: /dev/kvm does not exist
HINT: sudo modprobe kvm_amd
INFO: Your CPU supports KVM extensions
INFO: KVM (svm) is disabled by your BIOS
HINT: Enter your BIOS setup and enable Virtualization Technology (VT),
and then hard poweroff/poweron your system
KVM acceleration can NOT be used
La commande à lancer pour mémoire: ./emulator/emulator -show-kernel -no-audio -no-window -no-boot-anim -avd smartphone
Malheureusement pas accès à mon laptop-yunohost pour accéder au bios… Et de souvenir c’est un bios super bateau où y a pas moyen d’activer AMD-V. Je vais donc laisser tomber l’option sur mon laptop-yunohost (https://www.sony.co.uk/electronics/support/laptop-pc-sve-series/sve1112m1e/downloads)
La solution qui se profile est la suivante:
- Suivre le tuto https://nos-oignons.net/wiki-admin/Procédures/Fabriquer_une_VM_Android_pour_le_Credit_Mutuel/ pour installer sur un laptop une KVM LineageOS 14.1 (android 7.1.2 qui est compatible whatsapp) l’ISO est dispo ici: https://www.android-x86.org/releases/releasenote-cm-x86-14-1-r4.html
- Suivre les étapes de tuto dispo ici et https://github.com/tulir/mautrix-whatsapp/wiki/Android-VM-Setup
- déplacer le KVM complet sur vps.arn-fai.net
Je vais tenter ca sur mon laptop ubuntu dans les prochains jours. Coté déployement sur l’infra j’attends vos retours @ljf @Gyom
Une première question se pose pour le déploiement sur ganeti : kernel 4.9 ou 4.19 ? x86 ou x86-64?
J’admire ta ténacité
Concernant la solution que tu proposes :
- je ne connaissais pas les LineageOS x86, ca peut être amusant
- Je tâtonne un peu avec les VM, du coup pour être sur : si KVM est ton hyperviseur, ta machine virtuelle sera QEMU ? Du coup sais tu comment configurer la camera ? Le tuto se place dans le cas de l’utilisation de l’émulateur du Android SDK… si j’ai bien compris il s’agit d’un QEMU2 (https://developer.android.com/studio/run/emulator-commandline) mais je n’ai pas trouvé d’équivalent à la commande « camera ».
Sinon quel retour attends tu de moi ?
Bon courage
Moi j’ai l’impression que depuis 6 mois je me dis « aujourd’hui je finis le setup » et à chaque fois je reste bloqué et découvre que le setup doit etre modifié…
J’ai l’impression que t’es mieux calé que moi sur les VM, je balance des mots clés que je ne comprends pas pour l’instant. Dans l’idée je pense que ce serait bien qu’on ait chacun un setup sur notre laptop où on peut mettre en place la VM whatsapp et initialiser le bridge. Et ensuite qu’on sache mettre en prod le truc sur une VM ARN android depuis notre laptop. A l’image de ce que nos oignons fait avec l’appli Credit mut’. J’ai les accès à l’infra VPS donc, je regardera de ce coté avec les autres. Si tu as du temps tu pourrais donc refaire tes tests avec LineageOS-x86 et sans te soucier d’utiliser une webcam virtuelle, juste prendre celle de ton laptop.
Je n’ai pas de laptop et pas de webcam
Mais j’entends ton désespoir ce que je vais déjà tenter de faire c’est de monter une VM QEMU avec un LineageOS-x86 dedans. Je verrai ensuite pour la partie camera (d’autre se sont visiblement posés des questions mais ca date https://netaz.blogspot.com/2014/02/android-qemu-and-camera-emulating.html)