We are using NoxPlayer for our project, which requires us to open and close NoxPlayer at specific times. This process works fine with a single instance of NoxPlayer running on port 62001. However, we are encountering several issues when attempting to open a second instance, NoxPlayer2:
We need to determine a unique identifier that can be used to open NoxPlayer1 and NoxPlayer2. Currently, our code only opens the default NoxPlayer.
We want to assign a permanent and static port number to each NoxPlayer instance, such as:
NoxPlayer1: 62001
NoxPlayer2: 62002
Occasionally, we experience issues when connecting with ADB commands.
Please assist us in resolving these issues.
I have tried opening Nox player in Python code via instance name , pid, vmpid and IMEI no but it always opens up first nox player.
Here is the code
def open_nox(instance_name):
try:
print(f"Launching NoxPlayer instance with name: {instance_name}")
command = [nox_path, 'launch', f'-name:{instance_name}']
print(f"Command: {' '.join(command)}") # Debug output
# Launch the Nox instance
process = subprocess.Popen(command)
time.sleep(20) # Allow time for Nox to start
return process
except Exception as e:
print(f"Failed to open NoxPlayer instance with name: {instance_name}: {e}")
return None
Abhishek Thakur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.