[HOW TO] Make your own Android Toolkit for Windows in C# - Make it to your liking!

Search This thread

QuantumCipher

Member
Jul 25, 2012
40
63
[HOW TO] Make your own Android Toolkit for Windows using C#

In this tutorial it will show you how to use Windows C# to create your very own toolkit for use of simple ADB commands.

Such as:

- Rebooting your Device.
- Rebooting to Recovery/CWM or Bootloader.
- Installing APK's directly to your device.
- Installing general files to the SDCARD
- Pushing and Pulling files


Or if you look into it enough you can Implement such features as:

- Rooting your Device.
- Unlocking/Locking Bootloader.
- File Permissions.

( These won't Be covered in this Tutorial, as they require much more time, especially Rooting. )

Knowledge required

- A set up Visual C# Studio ready to use on your PC. It can be downloaded here : http://www.microsoft.com/visualstudio/eng/downloads
- General knowledge about C# such as using buttons, text boxes and the actual studio.


Getting Started


So once you have set up your Visual C# studio, create a windows Form application and mess around with the user interface a little if you like to make it to your taste. :highfive:

So here is a picture of my preview:

I have applied a few different ADB tasks buttons as you can see, Including APK install using a Textbox to store your chose directory of the selected file.( As well as a few colour and form name changes to make it more appealing )

0a130bc89b820603812c24c1bbc13605



Writing the ADB commands to the chosen Buttons in your application.​

Now we want to click on the ADB reboot button until it changes to the code layout as such...


d1bc09b7dbbf26557f2423eb54f1f3c1

Now we have this layout we want to add the namespaces :

using System.IO;
using System.Diagnostics;


These will allow use for CMD and Process features.

Adding ADB commands to the Buttons

How you have your ADB reboot button code ready to write to.

Use this function: and insert it in between the two Curly brackets ;)
{
var process = Process.Start("CMD.exe", "/c adb reboot");
process.WaitForExit();

}

48af9885f7461ef03e943671bc90157c
[/B]

Such as:

MessageBox.Show("Device is Now Rebooting..");

The line uses CMD.exe as the process which will run it as an application and use the /c (command) to execute "adb reboot".

Which will reboot the connected device as long as it's android..

So once you have gone through using the correct ADB commands your application code will look like this..

708eca1b20d5b8d37b62f55ca6e23da6

The ADB wont work yet when running a debug version, so don't try and execute any commands yet.. The adb.exe and a couple of other files need to be stored in the same folder as your toolkit as a resource for ADB to run off of.


Using Textboxes and OpenFileDialog to Install .APK files.​

So once you have clicked the two buttons and textbox.

64c6eab5c4d68b76e02bbf0f7eb68aa3


Setting you up ready to code it will look like this:

83e71c71e5459d3a67049b87af54b3d8


ADDING CODE


Assuming you have added OpenFileDialog to your Form Design!

We can now add code to the 2 buttons and text box.

It will look like this after adding the following to segments of code.

aca821237d3e62d8f2736314027c2a3a


Add this to Open APK button:

openFileDialog1.InitialDirectory = @"C:\";
openFileDialog1.Title = "Select your APK..";
openFileDialog1.FileName = "Choose File..";
openFileDialog1.CheckFileExists = true;
openFileDialog1.CheckPathExists = true;
openFileDialog1.Filter = " .APK|*.apk";

if (openFileDialog1.ShowDialog() == DialogResult.OK)
{

textBox1.Text = openFileDialog1.FileName;


}​

And add this to Install APK file button:

var process = Process.Start("CMD.exe", "/c adb install " + textBox1.Text);
process.WaitForExit();
MessageBox.Show(".APK is Installed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);​

Now' that is almost it!

Once you have saved and Built a release version of the tool.
Put the .exe from release of the saved directory into a folder ALONG with ADB.exe, ADBWinAPI.DLL and ADBWINUSBAPI.DLL


These ADB files a part of the Android platform tools from the SDK manager. You should already have these if you want to do this process :D
- If not just google them or download the SDK manager and find them.


4404b160672ac4ec923d3f0aa6d50793


Now That's it!


I think I have covered most parts if you want to write your own processes for ADB to execute feel free to do so..

I thought it maybe nice for people who liking personalizing their devices to also personalize toolkits for themselves also!

Thanks and Enjoy if you have any Issues or problems feel free to ask!



Enjoy, QuantumCipher
;)

You can keep upto date on anything I'm doing via Facebook http://www.facebook.com/Quantumcipher

or Youtube https://www.youtube.com/user/QuantumCipher
 
Last edited:

Miniqpa

Senior Member
Feb 13, 2012
148
11
Very nice tutorial!
As long it is a nexus device the rooting and flash cwm thing is the same thing except you're using fastboot commands.


kind regards
 
  • Like
Reactions: povoking

menglim

Senior Member
Jan 24, 2011
160
15
How can I get output text from cmd.exe? For example, if I have another textbox, and I want to display text. Text can be
Waiting for device ......(in case device not found)
Adb server start......depend on cmd.exe output.

Sent from my Spirit S using xda premium
 

OmarBizreh

Inactive Recognized Developer
Oct 26, 2011
2,109
3,499
Damascus
plus.google.com
Also, you could show them how to integrate my AndroidLib .NET library into it to handle all of the adb stuff :)

+1 on that, it's the shortest way and it was the reason behind Droid Manger existence, thus this tutorial shows what goes inside your lib and it's useful for those who are learning C# for the first time, or never interacted with a process in their app :good:

OP keep up the good work :cowboy:

@menglim:
To get out put from a process, here is an example:
Code:
Process process = new System.Diagnostics.Process();
                        ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                        startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                        startInfo.RedirectStandardInput = true;
                        startInfo.RedirectStandardOutput = true;
                        startInfo.RedirectStandardError = true;
                        startInfo.UseShellExecute = false;
                        startInfo.FileName = "cmd.exe";
                        process = Process.Start(startInfo);
                        process.StandardInput.WriteLine(Command_You_Want_To_Give_To_Your_Process);
                        outputTextBox.Text = process.StandardOutput.ReadToEnd();

Hope this helps :)
 
Last edited:

menglim

Senior Member
Jan 24, 2011
160
15
+1 on that, it's the shortest way and it was the reason behind Droid Manger existence, thus this tutorial shows what goes inside your lib and it's useful for those who are learning C# for the first time, or never interacted with a process in their app :good:

OP keep up the good work :cowboy:

@menglim:
To get out put from a process, here is an example:
Code:
Process process = new System.Diagnostics.Process();
                        ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                        startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                        startInfo.RedirectStandardInput = true;
                        startInfo.RedirectStandardOutput = true;
                        startInfo.RedirectStandardError = true;
                        startInfo.UseShellExecute = false;
                        startInfo.FileName = "cmd.exe";
                        process = Process.Start(startInfo);
                        process.StandardInput.WriteLine(Command_You_Want_To_Give_To_Your_Process);
                        outputTextBox.Text = process.StandardOutput.ReadToEnd();

Hope this helps :)

yes, it works but there is cmd.exe window pop up....after I close this window, then I can get the output. it is not in real time...thanks
 

squabbi

Senior Member
Jul 20, 2012
1,744
1,599
Sydney
+1 on that, it's the shortest way and it was the reason behind Droid Manger existence, thus this tutorial shows what goes inside your lib and it's useful for those who are learning C# for the first time, or never interacted with a process in their app :good:

OP keep up the good work :cowboy:

@menglim:
To get out put from a process, here is an example:
Code:
Process process = new System.Diagnostics.Process();
                        ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                        startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                        startInfo.RedirectStandardInput = true;
                        startInfo.RedirectStandardOutput = true;
                        startInfo.RedirectStandardError = true;
                        startInfo.UseShellExecute = false;
                        startInfo.FileName = "cmd.exe";
                        process = Process.Start(startInfo);
                        process.StandardInput.WriteLine(Command_You_Want_To_Give_To_Your_Process);
                        outputTextBox.Text = process.StandardOutput.ReadToEnd();

Hope this helps :)

Thanks for sharing this code! :)

Is it possible for the output to show as it appears on cmd?

Thanks :)
 
  • Like
Reactions: jonahly

0lzi

Member
Oct 25, 2011
11
1
Saw this last week, never programmed with C# but thought what the hell i have already done C++ at uni, some java for making an android app
so i downloaded VS2012 opened up google and went nuts, i now have a toolkit so far, downloads the sdk, extracts the sdk ( yea i know i could just pack the adb .dll's and .exe but while learning the language i might as well learn other stuff.) and i have backup/restore options for /sdcard/ and /dcim/ folders and a folder picker for backing up, contacts backup/restore ( looking to create something that will export it as a CSV or something)

so a big thanks for shedding some light on where to get started on this, now i cant stop and want to make a toolkit will loads of features lol :victory:
 
  • Like
Reactions: QuantumCipher

QuantumCipher

Member
Jul 25, 2012
40
63
Saw this last week, never programmed with C# but thought what the hell i have already done C++ at uni, some java for making an android app
so i downloaded VS2012 opened up google and went nuts, i now have a toolkit so far, downloads the sdk, extracts the sdk ( yea i know i could just pack the adb .dll's and .exe but while learning the language i might as well learn other stuff.) and i have backup/restore options for /sdcard/ and /dcim/ folders and a folder picker for backing up, contacts backup/restore ( looking to create something that will export it as a CSV or something)

so a big thanks for shedding some light on where to get started on this, now i cant stop and want to make a toolkit will loads of features lol :victory:

Thanks very much for the kind remarks everybody, it's extremely nice to know that this tutorial has helped you get into C# and this exact comment you made is what is going to get me back into this scene :good:


I will start looking into rooting devices and how I can incorporate them into ADB programs and maybe other things.
 
Last edited:

k1ll3r8e

Senior Member
Mar 4, 2011
724
670
Delmenhorst
HTC Sensation
HTC One (M9)
+1 on that, it's the shortest way and it was the reason behind Droid Manger existence, thus this tutorial shows what goes inside your lib and it's useful for those who are learning C# for the first time, or never interacted with a process in their app :good:

OP keep up the good work :cowboy:

@menglim:
To get out put from a process, here is an example:
Code:
Process process = new System.Diagnostics.Process();
                        ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                        startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                        startInfo.RedirectStandardInput = true;
                        startInfo.RedirectStandardOutput = true;
                        startInfo.RedirectStandardError = true;
                        startInfo.UseShellExecute = false;
                        startInfo.FileName = "cmd.exe";
                        process = Process.Start(startInfo);
                        process.StandardInput.WriteLine(Command_You_Want_To_Give_To_Your_Process);
                        outputTextBox.Text = process.StandardOutput.ReadToEnd();

Hope this helps :)

Hey all together,

1st THX for this great thread!

-

I have some problems to get the "fastboot" output in my c# programm...

i tired it with adb and some other cmd tools all give me an output but fastboot not :(

Here my cmd launcher:

//Launch silent CMD
private string run_silent_cmd(string args, bool w = true, bool o = true)
{
string request = "";
Process process = new System.Diagnostics.Process();
ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.UseShellExecute = false;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/Q/C" + args;
process = Process.Start(startInfo);
if (o)
{
request = process.StandardOutput.ReadToEnd();
}
if (w)
{
process.WaitForExit();
}
return request;
}

can some1 gimme a kick in the right direction?

Regards,
Sebastian
 
Last edited:

QuantumCipher

Member
Jul 25, 2012
40
63
Hey all together,

1st THX for this great thread!

-

I have some problems to get the "fastboot" output in my c# programm...

i tired it with adb and some other cmd tools all give me an output but fastboot not :(

Here my cmd launcher:

//Launch silent CMD
private string run_silent_cmd(string args, bool w = true, bool o = true)
{
string request = "";
Process process = new System.Diagnostics.Process();
ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.UseShellExecute = false;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/Q/C" + args;
process = Process.Start(startInfo);
if (o)
{
request = process.StandardOutput.ReadToEnd();
}
if (w)
{
process.WaitForExit();
}
return request;
}

can some1 gimme a kick in the right direction?

Regards,
Sebastian

Have you added the Fastboot.exe to your resources - for the program your making?
 

OmarBizreh

Inactive Recognized Developer
Oct 26, 2011
2,109
3,499
Damascus
plus.google.com
@k1ll3r8e
Hey all together,

1st THX for this great thread!

-

I have some problems to get the "fastboot" output in my c# programm...

i tired it with adb and some other cmd tools all give me an output but fastboot not :(

Here my cmd launcher:

//Launch silent CMD
private string run_silent_cmd(string args, bool w = true, bool o = true)
{
string request = "";
Process process = new System.Diagnostics.Process();
ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.UseShellExecute = false;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/Q/C" + args;
process = Process.Start(startInfo);
if (o)
{
request = process.StandardOutput.ReadToEnd();
}
if (w)
{
process.WaitForExit();
}
return request;
}

can some1 gimme a kick in the right direction?

Regards,
Sebastian

Your variable "args" should include the path for Fastboot.exe or your code should be like this (I'm using an example path in this example, you must replace it with your own path):
startInfo.Arguments = "/Q/C " + @"C:\AdbTools\fastboo.exe " + args;

OR

startInfo.Arguments = String.Join(" ", "/Q/C", Path.Combine("C:","AdbTools","fastboot.exe"), args);

(The first parameter passed in String.Join refers to separator string)
-------------------------------------------------------

@menglim
yes, it works but there is cmd.exe window pop up....after I close this window, then I can get the output. it is not in real time...thanks

try this, enter it after you define ProcessStartInfo (let's say you named it just like in the code snippet I gave)

startInfo.CreateNoWindow = true;

now window should disappear.
if not, remove this line and keep the one I gave you in this comment: startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
-------------------------------------------------------


@squabbi
Thanks for sharing this code! :)

Is it possible for the output to show as it appears on cmd?

Thanks :)

it's possible but a bit tricky, you can start by making the "Label" / "TextBlock" / "TextBox" or whatever UIElement you are using and set it's background to black and it's foreground to white, then choose "Console" font family, this should get you "Close enough" to the same output style :)


Note for anyone passing by this page:
  • When dealing with Directories in C#, ALWAYS use this code snippet, I will explain why at the end of this comment:
    Path.Combine("Root Dir","SubDir1","SubDir2","File_You_Want_To_Use");

    Where: Root Dir could be any logical partition you have on your HDD or the root dir of your application.
    in my case in Droid Manager I have an internal variable (called: ExecutablePath) that saves the path of Droid Manager after installation, so in my case when I want to call an Init.d script example I use the following code snippet:

    Path.Combine(ExecutablePath,"Initd_Scripts", "File_Name");

  • When wanting to add multiple strings together use this following code snippet:
    String.Join(Separator String, params string Arguments);

Those ensure the best result, by that I mean be sure system will read them they way they are intended to be read, if you use "+" or "\\" or "@" there might be some misunderstanding by the system which happened to me when I started learning programming 7 years ago.

Good Luck :)
 
Last edited:

k1ll3r8e

Senior Member
Mar 4, 2011
724
670
Delmenhorst
HTC Sensation
HTC One (M9)
@k1ll3r8e


Your variable "args" should include the path for Fastboot.exe or your code should be like this (I'm using an example path in this example, you must replace it with your own path):
startInfo.Arguments = "/Q/C " + @"C:\AdbTools\fastboo.exe " + args;

OR

startInfo.Arguments = String.Join(" ", "/Q/C", Path.Combine("C:","AdbTools","fastboot.exe"), args);

Thx for the info ;)

but... "Path.Combine" tells me only 2 strings can be combined so its useless for me coz i get the path via "Application.StartupPath" and i have 2 subfolder this means i have 3 strings to combine^^

thats why i set some vars in my form...

//KIT Vars
private static string KIT = Application.StartupPath + "\\";
private static string ADB = KIT + "adb\\adb.exe";
private static string FBT = KIT + "adb\\fastboot.exe";


also fastboot will not output anything :(

i googled a bit and found some threads... in this threads they say fastboot dun use the "flush" command (!?) this will mean the output is not grab able...

i think they are right^^ coz adb or cmd it self will output something via my function only fastboot returns nothing...
 

OmarBizreh

Inactive Recognized Developer
Oct 26, 2011
2,109
3,499
Damascus
plus.google.com
yes, it works but there is cmd.exe window pop up....after I close this window, then I can get the output. it is not in real time...thanks


Thanks for sharing this code! :)

Is it possible for the output to show as it appears on cmd?

Thanks :)

Thx for the info ;)

but... "Path.Combine" tells me only 2 strings can be combined so its useless for me coz i get the path via "Application.StartupPath" and i have 2 subfolder this means i have 3 strings to combine^^

thats why i set some vars in my form...

//KIT Vars
private static string KIT = Application.StartupPath + "\\";
private static string ADB = KIT + "adb\\adb.exe";
private static string FBT = KIT + "adb\\fastboot.exe";


also fastboot will not output anything :(

i googled a bit and found some threads... in this threads they say fastboot dun use the "flush" command (!?) this will mean the output is not grab able...

i think they are right^^ coz adb or cmd it self will output something via my function only fastboot returns nothing...


Nope not true, Path.Combine takes more than two args. I've passed to it 4 args in Droid Manager, here is a screenshot about it:

attachment.php


Also be sure that you remove this:
using System.Windows.Shapes;

and replace it with:
using System.IO;

so that the correct "Path" class is being called. if it's not there then no need to do anything just be sure System.IO is added.


Also "Flush" command means the same as in the image below:

attachment.php


Fastboot does show output but on certain commands, for example when you type: Fastboot devices
you will get an output IF AND ONLY IF you have a connected device in Fastboot mode.
Or when you unlock a Sony Xperia bootloader you will get output.
 

Attachments

  • pat.png
    pat.png
    4.3 KB · Views: 1,773
  • flush.png
    flush.png
    2.7 KB · Views: 1,766
Last edited:

k1ll3r8e

Senior Member
Mar 4, 2011
724
670
Delmenhorst
HTC Sensation
HTC One (M9)
Nope not true, Path.Combine takes more than two args. I've passed to it 4 args in Droid Manager, here is a screenshot about it:

attachment.php


Also be sure that you remove this:
using System.Windows.Shapes;

and replace it with:
using System.IO;

so that the correct "Path" class is being called. if it's not there then no need to do anything just be sure System.IO is added.


Also "Flush" command means the same as in the image below:

attachment.php


Fastboot does show output but on certain commands, for example when you type: Fastboot devices
you will get an output IF AND ONLY IF you have a connected device in Fastboot mode.
Or when you unlock a Sony Xperia bootloader you will get output.

Thx for the fast reply ;)

My doc beginning is

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using System.Reflection;

but see img below ;)

pathcombine.png


the thing with the streamwriter i dun understand^^ - tried it yesterday a few times but with no luck :(

Finally i think im too dumb... coz "adb.exe version" give me an output and "adb start-server" brings my proggy to hangup^^
 
Last edited:

OmarBizreh

Inactive Recognized Developer
Oct 26, 2011
2,109
3,499
Damascus
plus.google.com


Thx for the fast reply ;)

My doc beginning is

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using System.Reflection;

but see img below ;)

pathcombine.png


the thing with the streamwriter i dun understand^^ - tried it yesterday a few times but with no luck :(

Finally i think im too dumb... coz "adb.exe version" give me an output and "adb start-server" brings my proggy to hangup^^



Hmmm... Windows Form, to be honest the last time I worked with Windows Form application was two years ago, since 2011 I program WPF projects, which Microsoft is focusing on + it is more flexible when it comes to App UI and data bindings, that's why I use it.
There are differences between Windows Form and WPF unfortunately :-/

By the way if you consider switching to WPF you need to also learn XAML language (not XML, it's XAML) so you can play with the UI the way you want.

Good luck :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    [HOW TO] Make your own Android Toolkit for Windows using C#

    In this tutorial it will show you how to use Windows C# to create your very own toolkit for use of simple ADB commands.

    Such as:

    - Rebooting your Device.
    - Rebooting to Recovery/CWM or Bootloader.
    - Installing APK's directly to your device.
    - Installing general files to the SDCARD
    - Pushing and Pulling files


    Or if you look into it enough you can Implement such features as:

    - Rooting your Device.
    - Unlocking/Locking Bootloader.
    - File Permissions.

    ( These won't Be covered in this Tutorial, as they require much more time, especially Rooting. )

    Knowledge required

    - A set up Visual C# Studio ready to use on your PC. It can be downloaded here : http://www.microsoft.com/visualstudio/eng/downloads
    - General knowledge about C# such as using buttons, text boxes and the actual studio.


    Getting Started


    So once you have set up your Visual C# studio, create a windows Form application and mess around with the user interface a little if you like to make it to your taste. :highfive:

    So here is a picture of my preview:

    I have applied a few different ADB tasks buttons as you can see, Including APK install using a Textbox to store your chose directory of the selected file.( As well as a few colour and form name changes to make it more appealing )

    0a130bc89b820603812c24c1bbc13605



    Writing the ADB commands to the chosen Buttons in your application.​

    Now we want to click on the ADB reboot button until it changes to the code layout as such...


    d1bc09b7dbbf26557f2423eb54f1f3c1

    Now we have this layout we want to add the namespaces :

    using System.IO;
    using System.Diagnostics;


    These will allow use for CMD and Process features.

    Adding ADB commands to the Buttons

    How you have your ADB reboot button code ready to write to.

    Use this function: and insert it in between the two Curly brackets ;)
    {
    var process = Process.Start("CMD.exe", "/c adb reboot");
    process.WaitForExit();

    }

    48af9885f7461ef03e943671bc90157c
    [/B]

    Such as:

    MessageBox.Show("Device is Now Rebooting..");

    The line uses CMD.exe as the process which will run it as an application and use the /c (command) to execute "adb reboot".

    Which will reboot the connected device as long as it's android..

    So once you have gone through using the correct ADB commands your application code will look like this..

    708eca1b20d5b8d37b62f55ca6e23da6

    The ADB wont work yet when running a debug version, so don't try and execute any commands yet.. The adb.exe and a couple of other files need to be stored in the same folder as your toolkit as a resource for ADB to run off of.


    Using Textboxes and OpenFileDialog to Install .APK files.​

    So once you have clicked the two buttons and textbox.

    64c6eab5c4d68b76e02bbf0f7eb68aa3


    Setting you up ready to code it will look like this:

    83e71c71e5459d3a67049b87af54b3d8


    ADDING CODE


    Assuming you have added OpenFileDialog to your Form Design!

    We can now add code to the 2 buttons and text box.

    It will look like this after adding the following to segments of code.

    aca821237d3e62d8f2736314027c2a3a


    Add this to Open APK button:

    openFileDialog1.InitialDirectory = @"C:\";
    openFileDialog1.Title = "Select your APK..";
    openFileDialog1.FileName = "Choose File..";
    openFileDialog1.CheckFileExists = true;
    openFileDialog1.CheckPathExists = true;
    openFileDialog1.Filter = " .APK|*.apk";

    if (openFileDialog1.ShowDialog() == DialogResult.OK)
    {

    textBox1.Text = openFileDialog1.FileName;


    }​

    And add this to Install APK file button:

    var process = Process.Start("CMD.exe", "/c adb install " + textBox1.Text);
    process.WaitForExit();
    MessageBox.Show(".APK is Installed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);​

    Now' that is almost it!

    Once you have saved and Built a release version of the tool.
    Put the .exe from release of the saved directory into a folder ALONG with ADB.exe, ADBWinAPI.DLL and ADBWINUSBAPI.DLL


    These ADB files a part of the Android platform tools from the SDK manager. You should already have these if you want to do this process :D
    - If not just google them or download the SDK manager and find them.


    4404b160672ac4ec923d3f0aa6d50793


    Now That's it!


    I think I have covered most parts if you want to write your own processes for ADB to execute feel free to do so..

    I thought it maybe nice for people who liking personalizing their devices to also personalize toolkits for themselves also!

    Thanks and Enjoy if you have any Issues or problems feel free to ask!



    Enjoy, QuantumCipher
    ;)

    You can keep upto date on anything I'm doing via Facebook http://www.facebook.com/Quantumcipher

    or Youtube https://www.youtube.com/user/QuantumCipher
    7
    Also, you could show them how to integrate my AndroidLib .NET library into it to handle all of the adb stuff :)
    6
    Thanks for the feedback everyone (Y) ....

    Not sure if everyone has no idea what C# is or Just like using developer stuff..
    4
    Also, you could show them how to integrate my AndroidLib .NET library into it to handle all of the adb stuff :)

    +1 on that, it's the shortest way and it was the reason behind Droid Manger existence, thus this tutorial shows what goes inside your lib and it's useful for those who are learning C# for the first time, or never interacted with a process in their app :good:

    OP keep up the good work :cowboy:

    @menglim:
    To get out put from a process, here is an example:
    Code:
    Process process = new System.Diagnostics.Process();
                            ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
                            startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                            startInfo.RedirectStandardInput = true;
                            startInfo.RedirectStandardOutput = true;
                            startInfo.RedirectStandardError = true;
                            startInfo.UseShellExecute = false;
                            startInfo.FileName = "cmd.exe";
                            process = Process.Start(startInfo);
                            process.StandardInput.WriteLine(Command_You_Want_To_Give_To_Your_Process);
                            outputTextBox.Text = process.StandardOutput.ReadToEnd();

    Hope this helps :)
    3
    Hey @QuantumCipher ! Thanks for your "How To".

    My Complete GUI only needs an cmd-console inside... don´t know how to do that. And i need something where i can see the command from "ADB-Shell". Screenshot of the GUI in my post before.

    Now i build all functions of my GUI as seperate *.exe.
    Screenshots of all my Tools attached.

    Code:
    adb.exe
    AdbWinApi.dll
    AdbWinUsbApi.dll
    &
    fb2png (from "Kyan He")

    need to be in the same folder as my *.exe to make it work.

    All output (screenshot, log, pulled files) will be in the same folder as the *.exe.

    You can download all my Tools from here: https://www.file1.info/album/n68Qund

    You´ll find "fb2png" here http://code.google.com/p/android-fb2png/downloads/list (Latest Version: "fb2png-0.0.2" ; download it and rename it to "fb2png")

    You need .NET Framework 4.0 installed.

    Code:
    Edit: 27.09.2013 New Tool "ADB-Wireless-ADB-Connect"
    Enable "ADB over network" in the developper options, or use an app to do. 
    Now use this tool to connect if you wan´t to use adb over w-land 
    and disconnect if you are finished
    -----------------------------------------------------------
    26.09.2013 New Tool "ADB-Install-APK-DD" V1.2: 
    Drag & Drop APK or Browse File 
    
    New Tool "ADB-Sideload-DD-V1.2":
    Drag & Drop ZIP for Sideload or Browse File
    
    New Tool "ADB-Push-DD-V1.1":
    Drag & Drop or Browse File, enter path on Device
    -----------------------------------------------------------
    25.09.2013: Updated Screenshot & Pull to V1.1
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone