Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,812,209 Members 36,990 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Install and run apk.file

Tip us?
 
stiphen
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2014
Default [Q] Install and run apk.file

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
Old
#2  
quentin330's Avatar
Senior Member
Thanks Meter 405
Posts: 448
Join Date: Feb 2012
Location: Bordeaux

 
DONATE TO ME
Quote:
Originally Posted by stiphen View Post
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...-command-line/
I think that is what you are looking for
Phones :
Galaxy S4 I9505, Nexus 5
Tablet :
Nexus 7 (2012)
Watch :
LG G Watch
 
stiphen
Old
(Last edited by stiphen; 1st September 2014 at 03:36 AM.)
#3  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2014
Quote:
Originally Posted by quentin330 View Post
http://delphi.org/2013/11/installing...-command-line/
I think that is what you are looking for
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
 
quentin330
Old
#4  
quentin330's Avatar
Senior Member
Thanks Meter 405
Posts: 448
Join Date: Feb 2012
Location: Bordeaux

 
DONATE TO ME
Quote:
Originally Posted by stiphen View Post
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
Phones :
Galaxy S4 I9505, Nexus 5
Tablet :
Nexus 7 (2012)
Watch :
LG G Watch
 
stiphen
Old
#5  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2014
Quote:
Originally Posted by quentin330 View Post
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
Old
#6  
quentin330's Avatar
Senior Member
Thanks Meter 405
Posts: 448
Join Date: Feb 2012
Location: Bordeaux

 
DONATE TO ME
Quote:
Originally Posted by stiphen View Post
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
Phones :
Galaxy S4 I9505, Nexus 5
Tablet :
Nexus 7 (2012)
Watch :
LG G Watch
 
stiphen
Old
#7  
Junior Member - OP
Thanks Meter 0
Posts: 26
Join Date: Mar 2014
Quote:
Originally Posted by quentin330 View Post
That's what you can do with the commands but you have to know which activity to open and in which package it is
as i am new .. i only know that i have installed an apk and is installed . now hoe come i know which package is this in and how can i run it

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes