[Q] Install and run apk.file

Search This thread

stiphen

Member
Mar 30, 2014
36
2
Is there any command on cmd.exe that would allow me to run apk.file after installing it .. like

adb install myapp.apk

This command will only install myapp onto the emulator and I have to manually run this application from the emulator (by performing single click on its icon).

What I want to do is use a command which not only installs the application but also run it or open it in the device after installation.
 

quentin330

Senior Member
Feb 24, 2012
453
406
Bordeaux
Is there any command on cmd.exe that would allow me to run apk.file after installing it .. like

adb install myapp.apk

This command will only install myapp onto the emulator and I have to manually run this application from the emulator (by performing single click on its icon).

What I want to do is use a command which not only installs the application but also run it or open it in the device after installation.

http://delphi.org/2013/11/installing-and-running-android-apps-from-command-line/
I think that is what you are looking for
 

stiphen

Member
Mar 30, 2014
36
2

after installing Myfile.apk

adb install Myfile.apk

and then try to run it in the device

adb shell am start -n com.other.Myfile.apk/.MainActivity


I get the error

Starting: Intent { cmp=com.other.Myfile.apk/ .MainActivity }
Error type 3
Error: Activity class {com.other.Myfile.apk/com.other.Myfile.apk.MainActivity} does not exist.


whereas Myfile.apk is installed
 
Last edited:

quentin330

Senior Member
Feb 24, 2012
453
406
Bordeaux
after installing Myfile.apk

adb install Myfile.apk

and then try to run it in the device

adb shell am start -n com.other.Myfile.apk/.MainActivity


I get the error

Starting: Intent { cmp=com.other.Myfile.apk/ .MainActivity }
Error type 3
Error: Activity class {com.other.Myfile.apk/com.other.Myfile.apk.MainActivity} does not exist.


whereas Myfile.apk is installed

You have to remplace com.other by the name of the package and MainActivity by the name of the activity you want to open
 

stiphen

Member
Mar 30, 2014
36
2
You have to remplace com.other by the name of the package and MainActivity by the name of the activity you want to open

As in my first post .. I said I install apk file into my device by

adb install myfile.apk

OK it is installed into my device .. Now with command I want to open/run installed apk in my device .. I know i can normally run it by touching its icon .. but i want to do the same through the command ..
 

quentin330

Senior Member
Feb 24, 2012
453
406
Bordeaux
As in my first post .. I said I install apk file into my device by

adb install myfile.apk

OK it is installed into my device .. Now with command I want to open/run installed apk in my device .. I know i can normally run it by touching its icon .. but i want to do the same through the command ..
That's what you can do with the commands but you have to know which activity to open and in which package it is