I’m new to Android development. My OS is WinXP.
I’m trying to install two different applications on an Android Device Emulator in command line.
-
I have two Android projects “ap1” and “ap2”.
-
In the “ap1” project directory, I ran “ant debug”. I got an “ap1.apk” executable.
-
In the “ap2” project directory, I ran “ant debug”. I got an “ap2.apk” executable.
-
I created an Android Virtual Device:
cmd_line> android create avd -n avd1 -t 1 –abi x86
-
I launched the emulator:
cmd_line> emulator -avd avd1 -verbose
-
The “adb devices” command returns:
List of devices attached
emulator-5554 device
-
I installed the first program on the emulator:
cmd_line> adb -s emulator-5554 install “ap1.apk”
-
I ran the program:
cmd_line> adb shell am start -a android.intent.action.MAIN -n my.pkg.android/.Activity1
=> It worked.
-
I installed the second program on the emulator:
cmd_line> adb -s emulator-5554 install “ap2.apk”
-
I ran the program:
cmd_line> adb shell am start -a android.intent.action.MAIN -n my.pkg2.android/.AnotherActivity1
=> It worked.
All this works except that the second executable “replaced” of the first one.
If I try to run the first executable, I get an error:
cmd_line> adb shell am start -a android.intent.action.MAIN -n my.pkg.android/.Activity1
Starting: Intent { act=android.intent.action.MAIN cmp=my.pkg.android/.Activity1 }
Error type 3
Error: Activity class {my.pkg.android/my.pkg.android.Activity1} does not exist.
It looks like I can’t have the two apps at the same time in the emulator.
What do you think?
What do I have to do to have the two apps available (at the same time) in the emulator?
Thank you for helping.
Best regards.
Presumably, you gave them the same package name. Package names must be unique on the device and unique in the Play Store (for apps you are planning to ship). If you wish two apps to be installable on the emulator at the same time, give them separate package names.