Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to connect to remote phone? #278

Closed
JinzhuWu opened this issue May 18, 2020 · 2 comments
Closed

Is there any way to connect to remote phone? #278

JinzhuWu opened this issue May 18, 2020 · 2 comments

Comments

@JinzhuWu
Copy link

I find that ViewClient can connect to multi phones by distinguishing different serialno on local PC, is there any way to connect to a phone in a remote PC(share USB serial) or connect by network?

device, serialno = ViewClient.connectToDeviceOrExit(serialno)

If it works, could you give me a demo?

@dtmilano
Copy link
Owner

Sure there is. You can find more information about adb over the network at https://developer.android.com/studio/command-line/adb.

Then you can connect using something like this in your command line

$ adb connect 192.168.1.100:555

and in you python script

device, serialno = ViewClient.connectToDeviceOrExit(serialno='192.168.0.1:5555')

@JinzhuWu
Copy link
Author

Thank you for your answer, this is a good way to complete some actions through the IP address of mobile network, and it can meet some of my requirements, but in one of my scenarios I need to modify the airplane mode, this action will cause the loss of ip address.
Is there any way to meet the needs of this scene, such as sharing USB?
Looking forward to your reply!

Sure there is. You can find more information about adb over the network at https://developer.android.com/studio/command-line/adb.

Then you can connect using something like this in your command line

$ adb connect 192.168.1.100:555

and in you python script

device, serialno = ViewClient.connectToDeviceOrExit(serialno='192.168.0.1:5555')

@dtmilano dtmilano closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants