Search code examples
c#android-emulatoradb

Use adb to control Android device by a c# software


I have an idea to write a c# software by Visual studio to control an Android device that is run by emulator like MEMU or NOX. I found out that I will need a thing name adb. By this adb I can do some jobs on android like take a screenshot, drag, click a point on screen, etc... But I don't know how to do it. This is the first time I heard about adb.

Could someone send me some documents or explain me a bit such as: - How to install adb - How to run a function in adb? Click on screen for example? - What is other things I need to install? so I can understand where I should start? Thank you so much. Sorry for my bad English.


Solution

  • You need to install Android Debug Bridge driver to your computer on this link: https://adb.clockworkmod.com/

    If you install it clearly, on cmd write "adb devices" and you can see devices which are connected to your pc or emulators. But I don't understand you, you can't design or write code on ADB. Some ADB commands for you:

    1. adb devices: list devices which are connected PC.
    2. adb root : connect device with root permissions.
    3. adb logcat: show device logs on command prompt.
    4. adb reboot: restart connected device.
    5. adb install/uninstall : about .apk
    6. adb pull/push : documents to device.

    You can see the list of commands on : http://adbshell.com/commands/adb-root