How to run already installed Apk in Eclipse Through command Promt? [duplicate] - android

This question already has answers here:
How to run (not only install) an android application using .apk file?
(7 answers)
Closed 7 years ago.
My apk is already installed in Emulator. I want to launch it again through command rather than opening a menu in Emulator. How to do this?

Simply run
adb shell am start -n com.package.name/com.package.name.ActivityName
in your command prompt.
The question is already answered in this post.

adb shell am start -n declared.manifest.package/real.activiy.package.MyActivity
See : http://developer.android.com/tools/help/shell.html for more details and options

Related

Android, adb: How I can do command: "adb logcat|grep com.myproject" on Windows machine? [duplicate]

This question already has answers here:
Is there a Pattern Matching Utility like GREP in Windows?
(32 answers)
Closed 5 years ago.
I need to redirect output of "adb logcat"
Also I need to filter this output. To show only text that contain text: com.myproject
So in Linux machine I use the next command in console:
adb logcat|grep com.myproject
And it's work fine. OK.
Now I need to do same on Windows 10 machine. Windows machine has no grep
utility.
So, how I can do this in Windows?
P.S. Windows 10 machine is not my. I has no credentials to install anything.
You can install and use Cygwin, it gives you many Unix tools like grep

Install app on connected device via cmd/terminal or by code [duplicate]

This question already has an answer here:
Difference between adb "install" command and "pm install" command?
(1 answer)
Closed 6 years ago.
I have one apk file which is stored internally on my samsung phone. I want to install that apk using cmd. I mean is there any command or any code available for that??? So, I can install that app via usb or is there any code to install app or is there any soure code to update my app.
Any help would be appreciated.
I tried following command which couldn't worked for me...
adb install example.apk
adb install -s example.apk
Before you can run your app on a device, you must enable USB debugging on your device. You can find the option under Settings > Developer options.
Once your device is set up and connected via USB, you can install your app using the adb tool:
adb -d install path/to/your_app.apk
For More details refer
https://developer.android.com/studio/build/building-cmdline.html

com.android.ddmlib.AdbCommandRejectedException: more than one device [duplicate]

This question already has answers here:
Eclipse detecting the same device multiple times
(4 answers)
Closed 4 years ago.
how to kill and start adb in window 8. i did in linux but do not have any idea in window 8 b'coz i am getting error of
com.android.ddmlib.AdbCommandRejectedException: more than one device. i restart my eclipse , changed my port but it is no working.
just simple delete the adb.exe file running in your Task Manager
I think your question is formed a bit differently, but the exception is the same so if you're facing the same problem I was then refer to this post. Worked for me.
Actually all I had to do was to exit Eclipse and then end adb.exe in Task Manager. Start Eclipse again and voilĂ , showing only the one device as it should.
You can open comand line, go to sdk/platform-tools folder
(C:\Users\Administrator\AppData\Local\Android\sdk\platform-tools - my path)
and run:
adb kill-server
adb start-server
Same answer if you receive "Offline Device"
Just look at the image, Chuck thanks for help!

How can I install / unistall applications using android code? [duplicate]

This question already has answers here:
install / uninstall APKs programmatically (PackageManager vs Intents)
(10 answers)
Closed 10 years ago.
Is it possible to install / uninstall applications on device by android code without user interaction ?
yeah it's possible You need to use Process and Runtime for execute adb command in Android grammatically.Suppose you wanna install an apk then you need to run ./adb install ~/Desktop/apkname.Similarly you need to use ./adb install command for this.
Process process=Runtime.getRuntime().exec("./adb install 'complete path of your apk file'");
Hope this will work Good luck.

Why does adb install <same-packagename-always-release> fail? [duplicate]

This question already has answers here:
Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application
(7 answers)
Closed 9 years ago.
I know that adb install will not replace an existing package if it's of a different build type (i.e. debug vs. release).
Eclipse also successfully replaces the debug apks whenever I run a debug session.
But when I attempt adb install for replacing an existing release apk with another release apk (same package name!), I get a failure message:
adb install myapp-release.apk
pkg: /data/local/tmp/myapp-release.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
745 KB/s (34310 bytes in 0.044s)
Wasn't that supposed to work? What am I missing?
I suppose if the app is already installed, you need to supply the -r key:
adb install -r myapp-release.apk
From the adb help:
'-r' means reinstall the app, keeping its data

Categories

Resources