H2SO4T / ARES

Black-box tool that uses Deep Reinforcement Learning to test and explore Android applications
GNU Affero General Public License v3.0
70 stars 21 forks source link

Q Learning and random seem not work well #6

Closed mingxiaoshan123 closed 2 years ago

H2SO4T commented 2 years ago

Dear @mingxiaoshan123, can you describe in detail your error? at the moment your issue is not useful.

Anyway I have tested both the algorithms, and they work.

mingxiaoshan123 commented 2 years ago

master branch Q : takes 5 positional arguments but 8 were given my command like this: python parallel_exec.py --instr_jacoco --save_policy --list_devices "Nexus6" --appium_ports "4723" --android_ports "5554" --path "apks" --timer 60 --algo Q --timesteps 4000 --app_dir "D:\android_project\ru.meefik.busybox_46_src\ru.meefik.busybox_46_src.tar.gz\app" I have change some code, then it is fixed.

H2SO4T commented 2 years ago

please note that --app_dir is not a flag of ARES.

mingxiaoshan123 commented 2 years ago

Hi, how to deal with unsupported signal? master branch random: ERROR Unsupported signal: 2 log like this: 2021-12-29T09:37:41.291625+0800 ERROR Unsupported signal: 2 2021-12-29T09:38:17.634472+0800 ERROR Unsupported signal: 2 2021-12-29T09:38:55.439177+0800 ERROR Unsupported signal: 2

2021-12-29T09:38:26.320041+0800 DEBUG <--- EPISODE RESET ---> 2021-12-29T09:38:28.842751+0800 DEBUG action: Open navigation drawer Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:31.898851+0800 DEBUG action: ru.meefik.busybox.MainActivity.androidx.appcompat.widget.LinearLayoutCompat. Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:33.107675+0800 DEBUG action: ru.meefik.busybox:id/outputView Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:33.685839+0800 DEBUG action: ru.meefik.busybox:id/removeBtn Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:34.495224+0800 DEBUG pressed menu button 2021-12-29T09:38:34.706071+0800 DEBUG action: android:id/button2 Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:35.531258+0800 DEBUG action: ru.meefik.busybox:id/outputView Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:36.090926+0800 DEBUG action: ru.meefik.busybox:id/outputView Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:36.650048+0800 DEBUG action: ru.meefik.busybox:id/removeBtn Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:37.451703+0800 DEBUG action: android:id/button1 Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:38.243559+0800 DEBUG pressed menu button 2021-12-29T09:38:38.401866+0800 DEBUG pressed menu button 2021-12-29T09:38:38.559064+0800 DEBUG action: ru.meefik.busybox:id/removeBtn Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:39.333311+0800 DEBUG pressed menu button 2021-12-29T09:38:39.524802+0800 DEBUG action: android:id/button2 Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:40.306887+0800 DEBUG action: Open navigation drawer Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:43.260549+0800 DEBUG action: ru.meefik.busybox:id/outputView Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:46.515203+0800 DEBUG action: ru.meefik.busybox:id/removeBtn Activity: ru.meefik.busybox.MainActivity 2021-12-29T09:38:55.439177+0800 ERROR Unsupported signal: 2

H2SO4T commented 2 years ago

The errors should be described always in details... Which version of android are you using? Which version of python are you using? Which version of the app are you using? Which version of appium are you using?

Anyway the error seems related to an unsupported version of android

H2SO4T commented 2 years ago

Using the latest version of this app: https://github.com/meefik/busybox/releases/tag/1.31.1 and 1) Android Version: 10 2) Python 3.8 3) Appium 1.22 4) random algorithm 5) these flags --list_devices "API31" --appium_ports "4270" --android_ports "5554" --path "apps" --timer 60 --rotation --internet --emu normal --platform_version 10 --iterations 10 --algo random --timesteps 4000 --trials_per_app 2

everything works fine.

mingxiaoshan123 commented 2 years ago

I'm sorry! Thanks for your advice, it's helpful, I will try it.

H2SO4T commented 2 years ago

Nice to help you, just remember to give me all the info about your config next time ;)