How to deploy android application to a device? - android

I developed an application. Now I want to deploy it on real device. Can any body please tell me the steps and the requirements to deploy it on a real device.
Thanks
Deepak

There are multiple ways:
If you don't use eclipse, you can use adb tool. adb -d install PATH_TO_YOUR_APK_FILE
If you use eclipse, you can click run application in eclipse's launch menu. If this doesn't work, make sure you have "USB Debugging Mode" checked on your android phone. It's in the application menu.
You can export your package and sign it! And then browse to it to install.

I just copy the APK for my project out of the /workspace/project/bin folder, and use Dropbox to send it to my device. Then I install the APK from Dropbox client on the device. (No need for cables!)

Hook up your SmartPhone through USB-cable and set your phone i debug mode found in Settings > Applications > Development > USB debugging. Next - run your project in eclipse and chose your device.
make sure 'Run configurations' is set to manual, or this will fail if set to automatic and the target is a emulator. To change this behaviour, go to 'Run > Run configurations > Target' and set 'Deployment Target Selection Mode' to manual. Click 'Close' and try again.

FYI, if you're on a Galaxy Nexus, you need to fish around Samsung's website to find the driver installer. Here it is : http://www.samsung.com/us/support/owners/product/SCH-I515MSAVZW
Note: If you're using adb -d install PATH_TO_YOUR_APK_FILE to install the apk on to your device,
you will need to run it from the adt-bundle-[magic]/sdk/platform-tools/ folder.
Better yet, add adb.exe to your $PATH, and you can run adb from your windows command line/ terminal.

Also, you have to set up your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
If you're developing on Mac OS X, it just works. Skip this step.
If you're developing on Linux see official Android guide here

Related

How to set adb connections for NOX player on Mac OS

I need to set nox emulator as my default emulator, but I need to set first adb connection, but I don't know where I can find the directory of nox app player.
Fortunately, as a Mac user, you don't have to worry too much about the directory of the Nox app player, because you don't have to use the executable nox_adb.exe, as do Windows users. Instead, you can, with a slight change, follow the steps in the Nox connection guide, but just look out, as a Mac user, for step 6, (according to vandebergz) :
Download & install Nox.
Start a project in Android Studio.
Start Nox App Player, and in Nox go to Nox system settings and turn
root mode to on, then save changes and restart Nox.
In Nox, go to Android settings and scroll down to About Tablet. Keep clicking on Build number until it shows that, "You are now a developer". In Android settings the Developer options will now be visible.
In Developer options, tick USB debugging.
(Mac only) Depending on whether or not adb and other tools are in your PATH (see below), type
adb connect 127.0.0.1:62001
from a suitable location. (This will connect localhost through port 62001 to the Android Debug Bridge.)
Android Studio should now detect Nox Player as a connectable device (although it may not appear named as Nox).
Please bear in mind that for this to work, if you're using Android Studio with default installation settings, you should either do step 6 from the directory of adb , which is usually ~/Library/Android/sdk/platform-tools ; or else you can do this from any location if you have adb and the other platform tools on your PATH. To add them to your PATH, if not done already, you'll need to open your hidden ~/.bash_profile file and add the lines:
export PATH=~/Library/Android/sdk/tools:$PATH
export PATH=~/Library/Android/sdk/platform-tools:$PATH
as described here.
Worked ok for me. :)

Eclipse IDE cannot connect to Mobile Device

I known there is lots of answers about this question, but still my mobile device not connected to eclipse IDE.
The following is what I already did:
1. restart adb or type command in cmd "adb kill-server/adb restart-server", eclipse find nothing in the devices.
2. execute netstat -aon|findstr "5037", finding there is only one process "adb" occupy the port
3. check the phone driver in device management, finding the phone is install correctly.
4. execute "adb devices":
List of devices attach
1f06cbba device
I thought may it's my phone's problem, so i remove it, and create a virtual device avd, the eclipse still don't work.
My Operating System is Windows 7 and Eclipse IDE Kepler.
can any body help me to successful run my first android helloworld?
Thanks a lot!!
additional explanation
debug mode is in phone is ON
adb is in the variable %path%(maybe some should answered)
try the latest adt-bunble in adroid website, it still don't work.
Try turning "developer options" on in your device. (Option you haven't tried).
To access these settings, open the Developer options in the system Settings. On Android 4.2 and higher, the Developer options screen is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
Have you added adb in your class path variables? If not , you should append the class path with following paths :
path-to-sdk/android-sdk/platform-tools
path-to-sdk/android-sdk/tools
Try re-installing ADT Plugin. Worked for me last time.
Install your current mobile Adb USB driver and update Google USB driver
Check the MTP/PTP mode for your device:
http://lh3.ggpht.com/-8UMNs7Vg_dY/UVC6_6PnbDI/AAAAAAAAAIg/NjKOvAp9cDs/02-select-camera-ptp-mode_thumb%25255B1%25255D.png%3Fimgmax%3D800
In some devices you can find this under Settings->Storage->Menu Options(three vertical bullet squares).
When you say->the phone debug mode is open, i assume your developer options usb debugging is already enabled

debugging android app via eclipse on bluestacks app player

I have read a few articles that BlueStacks App Player can be used to debug android apps via Eclipse, instead of the default android emulator.
Example article
But I think this refers to the Windows version, I was unable to get to it work on MacOS. Does anyone know how to debug using BlueStacks/eclipse on MAC?
adb connect localhost:10001
should do the trick.
Well, you can try another way:
1) First, open the DDMS via Window->Open Perspective->DDMS under Eclipse.
2) Then open BlueStacks App Player.(leave it opens)
3) After that switch back to Eclipse and you should notice there're two emulator under the Device tab.
Then click Reset adb under the small triangle at the Device tab.
After a few seconds, the another one emulator will disappear and you can proceed to the next step.
4) Then return back through Window->Open Perspective->Java under Eclipse.
5) Select your project and right click on it, choose Debug As->Debug Configurations
6) Under Android Application select your configuration or create a new one. On the Target tab choose Always prompt to pick deviceAfter this, select Apply then Debug.
7) Then select BlueStacks emulator in the prompt window, and finally select OK.
Alternatively, you can also open the BlueStacks App Player before Eclipse using the above steps(with minor changes).
For more info, visit the below links.(However, in Chinese...)
http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746950.html
http://www.cnblogs.com/hbbbs/archive/2012/10/30/2746979.html
Hopefully this will help you.
C:\>cd Program Files (x86)\Android\android-sdk\platform-tools
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb connect 127.0.0.1:5555
connected to 127.0.0.1:5555
C:\Program Files (x86)\Android\android-sdk\platform-tools>
Run Bluestacks.
open Command Prompt in Windows.
Go to Platform-tools using following command.
cd C:\Users\<username>\AppData\Local\Android\sdk\platform-tools
then write:
adb devices
With SDK tools 27 and later!
You get a list of devices detected by adb .. if BlueStacks-4 is installed you should see the device listed (emulator-555x).
For Mac users: localhost:5037 worked for me
BlueStacks bundles its own copy of adb, %PROGRAMFILES(x86)%\BlueStacks\HD-adb.exe. You can connect localhost with it, or any other command. BlueStacks 3 uses the default port 5555.

How do I connect to Kindle Fire for development?

What do I need to do to use my Kindle Fire for android development? (Specifically for testing my apps on the device.)
You can find the instructions for connecting Kindle Fire to the ADB in a PDF of instructions provided by Amazon.
Paraphrased from the document:
Edit the adb_usb.ini file (located in ~/.android/)
Add the lines:
0x1949
0x0006
Save the file.
Run these commands to restart adb:
adb kill-server
adb start-server
adb devices
NOTE: For Windows 7 users you need to download an additional driver.
Linux uses a different way to set up the device. According to Using Hardware Devices, you need to set up your Linux system as follows:
Edit /etc/udev/rules.d/51-android.rules as root, and add the following line (create this file if it does not exist):
SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0666"
Change the permission of this file by executing the following command as root:
chmod a+r /etc/udev/rules.d/51-android.rules
Reload the rules by executing the following command as root:
udevadm control --reload-rules
Run these commands to restart adb:
adb kill-server
adb devices
If everything is ok, you will see your Kindle Fire listed as a device.
I was also looking forward how to connect Kindle on the ADB, so what I had to do is:
Go to Settings->Security and Enable ADB.
I use a Mac, this probably works similarly from a Windows box.
First I configured the Kindle Fire to allow sideloaded apps. This isn't the default behavior, you have to click a checkbox in the settings.
From the Fire, I went to the app store and downloaded a DropBox app (free.)
From my dev machine, I registered on the DropBox website (also free.)
This gives you a dropbox folder on your dev box that will be synced automagically to your dropbox folder on the web.
Then, to develop, I compile the app to make a new apk, drag it to the dropbox folder, and use the DropBox app on the Fire fetch the apk file. It loads with the click of a button. It takes about 15 seconds tops to get the apk to the Fire. I don't need any extra cables, etc.
You must add a user defined site in Android SDK Manager:
Launch Android SDK Manager >> Tools >> Manager Add-on Site >> User
defined>> add http://kindle-sdk.s3.amazonaws.com/addon.xml
Then download the Amazon Kindle drivers from Android SDK Manager
Then then enable ADB from kindle settings.
Settings >> Device >> Enable ADB
And run \extras\amazon\kindle_fire_usb_driver, run KindleDrivers.exe
More info
Follow the PDF
In eclipse go to android SDK manager, select Tools -> Manage Add-on Sites -> select User Defined sites.
Select New and add the url as http://kindle-sdk.s3.amazonaws.com/addon.xml.
After adding that go to packages->Extras
Download Kindle Fire USB Driver.
Go to android SDK folder->amazon->install the drivers.
Last step: You can see the device at In Device Manager, under Kindle Fire, verify that the device appears as Android Composite ADB Interface.

installing .apk file in actual device only for testing

I want to test my application on actual device, so how can I go for it? And is it accessory to sign in and use zipalign for this purpose, or they are useful when preparing for publish my application? And is there any way to test my application on actual device without using eclipse?
download and install Android SDK
Make usb debugging enabled in your device
Connect your device to computer
go to command prompt and write: "adb devices" this will list all the devices connected
adb install "path/App.apk"
and you are done. Please note that adb command will run correctly from anywhere if you are having a correct path pointing to android sdk / plateform-tools direcory
I hope this will help you
Yes u can directly install your application into actual device without signing and zipalign. You can install the drivers for your software into your computer and use you device directly for debugging alternative to Emulator
Refer Using Hardware Devices
or you can install using Android adb tool Refer Installing an Application
or you can directly copy your application package file to you sdcard and install
The easy steps to install your apk using File manager :
Copy the APK
file you want to install to your phone's memory card.
And disconnect Phone from USB.
Go to Android Market and search and download Astro File Manager.
Click on the Install button.
After it is installed, open the app (Astro).
It will show you your application APK file stored directly in the root directory of your memory card.
Just tap on the application you want to install
Tap on “Open App Manager”
Click Install
You are done!
P.S: Don't forget to enable Unknown sources in Settings > Security.
And when installing via Eclipse enable USB Debugging > Developer Options
Some tips:
http://developer.android.com/distribute/open.html
You can install .apk files directly to your android device using the following steps:
Write click on your .apk file and choose send to -> your device
You can access it using "Astro File Manager" (downloadable app from play store) also you can click phone menue button
go to "My Files"
Select your .apk file to install it.

Categories

Resources