Install Android app in Eclipse without running it - android

I'm using Eclipse to develop a bunch of Android apps and I need to batch install them, either on the emulator or on an attached device. I'd like to be able to push them all to the device without running them individually in Eclipse.
How can I do that?

try using adb.
adb install -r your/path/to/file.apk
-r is forced install.
You can also create a batch file with number of adb install commands.

You could just push them to the emulator using "adb install fileN.apk" from the command line.

Related

ADB pair unknown command using r32 platform tools

I've just downloaded a fresh install of SDK platform tools since I don't need the IDE.
Version: r32.0.0
When using adb pair i get the following:
PS C:\*userpath*\platform-tools_r32.0.0-windows\platform-tools> adb pair
adb: usage: unknown command pair
Tried downloading fresh again, and still the same error. Do I need to install other packages aswell? I just want the command line tools.
Ended up using an ADB version I didn't know was installed. Opening PowerShell directly in the folder and running
./adb
Made it work, just fine.

Which adb commands does eclipse use to run app?

I'm working on an app that uses device admin. If I run the app on a device using eclipse, then make a minor change to the code, then run the app again, the app runs as you'd expect with the new change.
However, if the second time I run the app I use adb install I get:
Failure [INSTALL_FAILED_ALREADY_EXISTS]
If I try to uninstall then reinstall, the uninstall fails because the app is device admin. This has led me to wonder which adb commands eclipse executes when you select run. I've looked for some sort of "update" command but I couldn't find one. Anyone know?
You can use "adb install -r yourapp.apk" to install your system apk again.
If you want to run through command line, use
"adb shell am start -n acticityname_withpackage"

How to install android application in android without using adb?

i have just android terminal
i dont have adb to install apk.
i dont have double click on apk
and install that application.
so is there any command available using that i can install application on android shell?
Yes, try this:
pm install apk.apk

Installing an apk on android emulator on Mac OS

I tried following these steps(from here):
go to sdk folder, then go to tools.
copy your apk file inside the tool directory
./emulator -avd myEmulator
to run the emulator on mac
./adb install myApp.apk
to install app on the emulator
But when I run "./emulator -avd phoneEmulator" (phoneEmulator is the name of my emulator)
it just displays:
My-MacBook-Pro:tools myName$ ./emulator -avd phoneEmulator
2012-07-30 22:44:33.377 emulator-arm[2859:80b] Warning once: This application, or a
library it uses, is using NSQuickDrawView, which has been deprecated.
Apps should cease use of QuickDraw and move to Quartz.
It's as if that command is never returning.
If I can't input the 2nd command ./adb install myApp.apk in that window, where do I call it?
Open Terminal
go to android-sdk-mac\platform-tools
type ./adb install myApp.apk
You can work around by:
You have a *.apk file with you if you don't have, download it.
Open Android Studio and Run the emulator.
Open the finder and go to the location which contains your *.apk file.
Drag that *.apk and drop into the emulator and it will ask for confirmation after your confirmation it will install the *.apk in the emulator.
You can find it in application menu once installation succeeds.
First of all, you SHOULD NOT copy APKs to the tools or any other SDK directory.
Do not cd to the SDK directories, just add them to the PATH environment var or use their absolute path in command lines.
Then, if you want to run the emulator and then execute command from the same terminal, send the process to background (&):
$ export PATH=$PATH:/path/to/sdk/tools:path/to/sdk/platform-tools
$ emulator -avd myEmulator &
$ adb install /path/to/my.apk
You can work around by:
Upload yourapp.apk to internet. I.e: yourhost.com/yourapp.apk
Run emulator
Open internet browser on your emulator, visit link yourhost.com/yourapp.apk
Download and install
adb can be run from a seperate terminal once this emulator boots up.
May Be, Useful to all the command in MAC OS Terminal
Am I the only one whose apps install in the emulator when I run them as Android Application from eclipse?
I mean - why go though the trouble of adb when you could just use eclipse? (unless you have something against eclipse!)
Try this app. It will install the apk by just double clicking on it after you create an association to .apk files. It's all explained in the github source.
Alternatively You can use 'adb install' command as follows. "adbinstall/filename.apk"
ex. adb install /Users/manojclinberg/Downloads/ad3e0e46-d716-4fa9-b603-b8db3accf260.apk

Testing Android Applications on a Clean Emulator

When I want to test an android application, I create a new AVD, start it in the emulator, wait for the emulator to finish booting, and then use ADB to install the application, and when I'm done delete the AVD. Are there any tools that automate all of those steps? I tried writing my own but I couldn't find a way to tell if the emulator was completely booted, as the Android SDK website says not to use "adb wait-for-device install file.apk".
You're right not to use wait-for-device. It does not wait for the package manager to be available, which is what you need. I'm not sure how eclipse does it but you can poll the emulator until the package manager is available using the command adb shell pm path android. The command should return 'package: something'. Check out this python script that uses the technique: www.netmite.com/android/mydroid/1.6/.../adb_interface.py. It's pretty big but if you search for the command above you'll find the relevant piece of the script.
Why do you want to delete the AVD every time?
If you are deleting it every time because the install command throws an error due to the app already existing on the AVD, you can do this: adb install -r file.apk. The -r part is used for reinstalling the app. Here is the full usage instructions for adb.
Are you deleting it to remove the application you are testing and revert to a 'clean' emulator? If so it's not necessary to delete the AVD every time. You can specify the -wipe-data option when starting the emulator. This effectively resets the AVD to how it was when you created it. Here is the emulator documentation.
Hopefully that helps simplify your script.

Categories

Resources