Wednesday, 11 March 2015

Installing Android Studio and Deploy App on USB connected Android Device Instead of Emulator

In this post I am going to describe how to install Android Studio and make it work with your android device directly. The app will run directly on your android device which is connected using usb cable. If you don't have an android device than you can test your app on emulator. But Emulator is too slow to work with. If you have any android device( having min. android version ) can be used instead of emulator. That would be very much faster instead of working with emulator.


Installation:


1. First of we will see whether your system meet all the requirements which Android Studio needs.
   Visit this link to see the requirement.(depending which Operating System you are using)

2. If you meet all the hardware requirements, make sure that you have the latest version of java jdk and jre installed on your system. 

Note: The latest (till date) Android Studio needs java jdk7 or higher version.

You can download and install Java jdk and jre from the site below.

3. Now if you installed new java jdk and jre then set the environment variable PATH( in windows specifically) to the path where you have installed that jdk and jre.


 start(right click) -> system -> system advance setting ->advance -> environment variable

Set PATH Variable in Windows
If you have other than windows operating system you can search on google "how to set path variable for java jdk".

4. Now you are ready to install Android studio. Download it from the official website.


5. After downloading you will have the Android Studio adt bundle in your downloads.
                  android-studio-bundle-xxx.xxxxxxx.exe
         xxx.xxxxxxx will be your version which you have downloaded.

 click on it(for windows) and setup will start. It will ask simple things where you want to install ,language etc. go through it and install it. It will take little time. This process is easy.

Your android studio is installed . You can start developing android app but for changing the setting of the emulator to change it to your device go through the next process.

Setting your android device as default for running app instead of emulator:


1. First of all you will need an android device with min. android OS version(whichever you will  use  for developing app).

2. You need to download adb driver for your device. It is specific to every device. So search on google.
Download and install adb driver for your device.

3. You need to enable usb debugging in your phone. In older version(less than 4.2) there will be an option for developer in settings or application settings. Click on it you will get an option usb debugging.  Check that check box.

If you have android device having version 4.2 or higher go to settings -> about phone -> tap the build number 7 times.
Now go back to settings, you will find a developer option there. In which you will find the option for usb debugging.

Of course you have your phone is connected to system using usb.

Now your phone is ready. Just make a single change to android studio settings.

Changing Setting in Android Studio:



Near the button which is used to run the app a rotated green triangle in the following image. You will see a dropdown(app is written in the image) in which go to edit configuration and in Android Application go to app and general and set target device as usb. Following photo shows the Exact setting

Changing Setting in Android Studio


Now click on apply and ok. Attach your phone with usb. Restart Android Studio. Now whenever you run any app in Android Studio. It will be automatically deploy to your device instead of emulator. It is very much faster than the emulator.

I hope it helps. If you have any problems or queries do not hesitate to comment. May be I can help.
Till then enjoy developing your app.

2 comments:

Related Posts

Related Posts Plugin for WordPress, Blogger...