Hi Aleksei, my code runs successfully without errors, but I only see one app instance running even though I specified the appPath
to 2 different binaries. Is it possible to run the same app(same binary, same appPath) with multiple instances without using appPath
?
import time
import multiprocessing
from appium import webdriver as appium_webdriver
from appium.options.mac import Mac2Options
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
BUNDLE_ID = "com.company.companyapp"
if __name__ == "__main__":
appium_service = AppiumService()
appium_service.start(args=['--relaxed-security', '--address', '127.0.0.1', '-p', '4724'])
options = Mac2Options()
options.bundle_id = BUNDLE_ID
options.show_server_logs = True
options.system_port = 10101
options.no_reset = True
options.wait_for_quiescence = False
options.appPath = '/Users/usr/path1'
driver = appium_webdriver.Remote(f"http://{APPIUM_HOST}:4724", options=options)
driver.execute_script('macos: activateApp', {'bundleId': BUNDLE_ID})
appium_service2 = AppiumService()
appium_service2.start(args=['--relaxed-security', '--address', '127.0.0.1', '-p', '4725'])
options2 = Mac2Options()
#options2.bundle_id = 'com.apple.calculator'
options2.bundle_id = BUNDLE_ID
options2.show_server_logs = True
options2.system_port = 10103
options2.no_reset = True
options2.wait_for_quiescence = False
options2.appPath = '/Users/usr/path2'
driver2 = appium_webdriver.Remote(f"http://{APPIUM_HOST}:4725", options=options2)
driver2.execute_script('macos: activateApp', {'bundleId': BUNDLE_ID})
appium_service.stop()
appium_service2.stop()