{"id":28203429,"url":"https://github.com/hansalemaos/multiadbconnect","last_synced_at":"2025-10-06T01:21:56.562Z","repository":{"id":196406161,"uuid":"696077645","full_name":"hansalemaos/multiadbconnect","owner":"hansalemaos","description":"Establish a adb connection to different emulators at the same time (Bluestacks, MEmu, MuMu, LdPlayer ...) - Windows only","archived":false,"fork":false,"pushed_at":"2023-09-25T03:14:40.000Z","size":28,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T07:28:45.122Z","etag":null,"topics":["adb","android","automation","bluestacks","connect","dataframe","gameloop","genymotion","ldplayer","memu","mumu","nox","pandas","player","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/multiadbconnect/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hansalemaos.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-25T03:13:51.000Z","updated_at":"2025-09-03T22:00:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4682430-5b81-450e-bf3e-7ddc0610ce8d","html_url":"https://github.com/hansalemaos/multiadbconnect","commit_stats":null,"previous_names":["hansalemaos/multiadbconnect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hansalemaos/multiadbconnect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fmultiadbconnect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fmultiadbconnect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fmultiadbconnect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fmultiadbconnect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansalemaos","download_url":"https://codeload.github.com/hansalemaos/multiadbconnect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansalemaos%2Fmultiadbconnect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547276,"owners_count":26004768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adb","android","automation","bluestacks","connect","dataframe","gameloop","genymotion","ldplayer","memu","mumu","nox","pandas","player","python"],"created_at":"2025-05-17T01:16:05.949Z","updated_at":"2025-10-06T01:21:56.557Z","avatar_url":"https://github.com/hansalemaos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Establish an ADB connection to different emulators at the same time (Bluestacks, MEmu, MuMu, LdPlayer ...) - Windows only\r\n\r\n## Tested against Windows 10 / Python 3.11 / Anaconda\r\n\r\n## pip install multiadbconnect\r\n\r\n### The module is designed to facilitate the connection to Android emulators or devices using the Android Debug Bridge (ADB) tool. It offers several advantages and use cases:\r\n\r\n#### Automated Connection to Multiple Emulators/Devices of different brands: \r\n\r\nThe function allows you to connect to multiple emulators or devices at once \r\n\r\n#### Restarting ADB Server: \r\n\r\nIt provides an option (restart_server) to restart the ADB server before connecting, \r\nwhich can help in resolving connection issues or ensuring a clean start.\r\n\r\n#### Timeout Handling: \r\n\r\nYou can specify a connect_timeout, which is the maximum time the function will wait \r\nfor the connections to be established. This feature prevents the script from hanging \r\nindefinitely if a connection cannot be established.\r\n\r\n#### Process Monitoring: \r\n\r\nThe function monitors the state of the ADB connections by checking if the underlying ADB processes are alive. \r\nIf a connection becomes unresponsive, it kills the associated process, \r\nensuring reliable connections.\r\n\r\n#### Structured Output: \r\n\r\nIt returns a Pandas DataFrame containing information about the connected emulators/devices. \r\nThis structured output makes it easy to work with the data, filter, and perform operations on specific devices.\r\n\r\n\r\n```python\r\n\r\nArgs:\r\n\tadbexe (str): The path to the ADB executable.\r\n\trestart_server (bool, optional): Whether to restart the ADB server before connecting.\r\n\t\tDefaults to False.\r\n\tconnect_timeout (Union[float, int], optional): The maximum time (in seconds) to wait for\r\n\t\tthe connections to be established. Defaults to 15 seconds.\r\n\talive_sleep (Union[float, int], optional): The time (in seconds) to sleep between checking\r\n\t\tif the ADB connections are alive. Defaults to 3 seconds.\r\n\r\nReturns:\r\n\tpd.DataFrame: A DataFrame containing information about the connected emulators/devices.\r\n\r\nExample:\r\n\tfrom multiadbconnect import connect_to_all_emulators\r\n\tdf = connect_to_all_emulators(\r\n\t\tadbexe=r\"C:\\Android\\android-sdk\\platform-tools\\adb.exe\",\r\n\t\trestart_server=True,\r\n\t\tconnect_timeout=15,\r\n\t\talive_sleep=3,\r\n\t)\r\n\r\n\t# print(df.to_string())\r\n\t#          aa_serial                                                                               aa_details  aa_online              aa_exe                                                                                                                                             aa_cmdline  aa_pid aa_addr_ip aa_addr_port                                                                                   aa_psutil                                                   aa_adb\r\n\t# 0  127.0.0.1:21503                    device product:SM-N975F model:SM_N975F device:SM-N975F transport_id:6       True    MEmuHeadless.exe                (C:\\Program Files\\Microvirt\\MEmuHyperv\\MEmuHeadless.exe, --comment, MEmu, --startvm, 20230924-aaaa-aaaa-aaaa-000000000000, --vrde, off)   20064  127.0.0.1        21503    psutil.Process(pid=20064, name='MEmuHeadless.exe', status='running', started='23:03:52')  C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s 127.0.0.1:21503\r\n\t# 1   127.0.0.1:5565              device product:OnePlus5 model:ONEPLUS_A5000 device:OnePlus5 transport_id:37       True       HD-Player.exe                                                                                  (C:\\Program Files\\BlueStacks_nxt\\HD-Player.exe, --instance, Nougat64)    7896  127.0.0.1         5565        psutil.Process(pid=7896, name='HD-Player.exe', status='running', started='23:02:33')   C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s 127.0.0.1:5565\r\n\t# 2    emulator-5564              device product:OnePlus5 model:ONEPLUS_A5000 device:OnePlus5 transport_id:38       True       HD-Player.exe                                                                                  (C:\\Program Files\\BlueStacks_nxt\\HD-Player.exe, --instance, Nougat64)    7896  127.0.0.1         5565        psutil.Process(pid=7896, name='HD-Player.exe', status='running', started='23:02:33')    C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s emulator-5564\r\n\t# 3   127.0.0.1:7555  device product:cancro_overseas_x86_64 model:MuMu device:x86_64_overseas transport_id:10       True   Muvm6Headless.exe  (C:\\PROGRA~1\\MUVM6V~1\\HYPERV~1\\Muvm6Headless.exe, --comment, nemu-12.0-x64-overseas, --startvm, b702f309-c448-4f23-958b-6e5696ec6887, --vrde, config)   10312  127.0.0.1         7555   psutil.Process(pid=10312, name='Muvm6Headless.exe', status='running', started='19:41:34')   C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s 127.0.0.1:7555\r\n\t# 4   127.0.0.1:7556  device product:cancro_overseas_x86_64 model:MuMu device:x86_64_overseas transport_id:20       True   Muvm6Headless.exe  (C:\\PROGRA~1\\MUVM6V~1\\HYPERV~1\\Muvm6Headless.exe, --comment, nemu-12.0-x64-overseas, --startvm, b702f309-c448-4f23-958b-6e5696ec6887, --vrde, config)   10312  127.0.0.1         7556   psutil.Process(pid=10312, name='Muvm6Headless.exe', status='running', started='19:41:34')   C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s 127.0.0.1:7556\r\n\t# 5    emulator-5554                device product:SM-S908N model:SM_S908N device:star2qltechn transport_id:1       True  Ld9BoxHeadless.exe               (C:\\Program Files\\ldplayer9box\\Ld9BoxHeadless.exe, --comment, leidian0, --startvm, 20160302-aaaa-aaaa-0eee-000000000000, --vrde, config)    4716  127.0.0.1         5555   psutil.Process(pid=4716, name='Ld9BoxHeadless.exe', status='running', started='22:41:39')    C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s emulator-5554\r\n\t# 6    emulator-5556                device product:SM-S901N model:SM_S901N device:star2qltechn transport_id:2       True  Ld9BoxHeadless.exe               (C:\\Program Files\\ldplayer9box\\Ld9BoxHeadless.exe, --comment, leidian1, --startvm, 20160302-aaaa-aaaa-0eee-000000000001, --vrde, config)   13288  127.0.0.1         5557  psutil.Process(pid=13288, name='Ld9BoxHeadless.exe', status='running', started='20:46:59')    C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s emulator-5556\r\n\t# 7    emulator-5558                device product:SM-N976N model:SM_N976N device:star2qltechn transport_id:3       True  Ld9BoxHeadless.exe               (C:\\Program Files\\ldplayer9box\\Ld9BoxHeadless.exe, --comment, leidian2, --startvm, 20160302-aaaa-aaaa-0eee-000000000002, --vrde, config)    6148  127.0.0.1         5559   psutil.Process(pid=6148, name='Ld9BoxHeadless.exe', status='running', started='20:47:10')    C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s emulator-5558\r\n\t# 8    emulator-5560                device product:SM-G970N model:SM_G970N device:star2qltechn transport_id:4       True  Ld9BoxHeadless.exe               (C:\\Program Files\\ldplayer9box\\Ld9BoxHeadless.exe, --comment, leidian3, --startvm, 20160302-aaaa-aaaa-0eee-000000000003, --vrde, config)   17992  127.0.0.1         5561  psutil.Process(pid=17992, name='Ld9BoxHeadless.exe', status='running', started='20:47:22')    C:\\Android\\ANDROI~1\\PLATFO~1\\adb.exe -s emulator-5560\r\n\r\n\t# To send a key event to all connected devices/emulators (e.g., KEYCODE_HOME) and sleep 0.2 seconds between each command:\r\n\tdf.aa_adb.apply(lambda x: x('shell input keyevent KEYCODE_HOME') if not sleep(.2) else None)\r\n\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fmultiadbconnect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansalemaos%2Fmultiadbconnect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansalemaos%2Fmultiadbconnect/lists"}