Connect to android emulator with C# -
i have .apk package want push android emulator , run in emulator , receive events , debug message show user c# console program.
how should connect android emulator receiving debug message c# code console? please me. thanks.
this depends on how detail want. want view logcat or full debug info(like breakpoints , device statistics)?
in case of former:
you can use adb(android debug bridge):
processstartinfo adbstart = new processstartinfo(@"your_path\android-sdk\platform-tools\adb.exe", "-e logcat *:d"); adbstart.useshellexecute = false; process adb = new process() { startinfo = adbstart }; adb.start(); replace first parameter in constructor of adbstart path adb.exe, found in platform_tools folder of android sdk. second parameter console flags. above code forces adb connect emulator using -e flag , filters debug messages using *:d flag. should replace * relevant filter app(like package name). type adb help in console info on different flags.
since program runs in console, standard output of adb should directed console. if isn't, use streamreader @ adb.standardoutput read output of adb. can use adb.waitforexit() block thread until adb dies.
in case of latter:
the official way via dalvik debug monitor(android_sdk\tools\ddms.bat). since there no official support c# in android, debug monitor written in java , libs. can't find substitutes, sorry. java similar c# though, maybe can jump languages particular project?
Comments
Post a Comment