How to launch an existing app in Android emulator? - android

I have the code.google.com Android SDK, am able to launch the emulator and created a v3.0 object and its started and runs fine, but am just trying to "install" and launch an existing application. its a database viewer with a .apk extension. I have the source, but right now to start its a compiled app.
How is this done?
thanks!

fire up your emulator (it has to be running when you do this), then open Terminal and type
>adb install your_program.apk
You have to cd over to the directory where the file is, first.
(the > is the terminal prompt... not a character you should be typing)
oh, and if you then want to uninstall it, you can do it right through the emulator, of if you know the actual package name you can then do it like...
>adb uninstall com.full.package.name
Oh, and I guess I'm giving mac advice cause I'm on a mac... if you're on a PC you'll use the command prompt... I'm assuming the rest is the same.

Related

Running startup Command or Script in GNURoot Debian

Does anyone know how to auto-run a command or a script in GNURoot Debian when opening a new terminal window?
I'm trying to make make an SSH server run automatically when I open GNURoot,
so right now I'm manually typing:
service dropbear start
I found an "Initial Command" option in the GNURoot app preferences and typed the command in there, but it doesn't seem to do anything. Even worse it seems to make the new terminal window to open up in a non-working state where I can't run any command.
thanks!
First root your device. Then find the file com...xml in /data/data/com.gnuroot.debian/shared_prefs/, change its initialcommand value to empty. Then your gnuroot should launch ok. I just met this question and checked androidterm source code to find this solution.

How to use Youwave in place of Android Emulator

I've tried for days and failed to run AVD on my PC. So I decided to look for an alternative and found out that Youwave can be used as an emulator. Here is my question: How can I run Android source (apps not finished so they are not .apk) on Youwave?
You can't run Android Source which is not finished to become .apk.
The best alternative of emulator is Genymotion.
hopefully it would be useful for others that reach this page through googling,
run command prompt in windows by typing "cmd" in the search field of the start menu
change the directory to "platform-tools" in your sdk folder. For example, suppose that your sdk is located in "c:\android\source\sdk\" use the command "cd\android\source\sdk\platform-tools" for changing the current directory.
Run the following command for connecting YouWave to AndroidStudio:
"adb connect 127.0.0.1:5558"
Enjoy it!

android problems sending app to emulator from using terminal

I have launched an emulator with a:
android avd
(although the android developers site said do it from platform-tools, i did it from tools because the android command was there ,and not in platform-tools). Anyway the AVD manager appeared and I started one, and it launched just fine.
Then I tried to send my app to the emulator so (following the android developers instructions) I do a:
adb install /newApp.apk
the command prompt jumps to the next line and just blinks.....when i check the emulator nothing has changed...where am i going wrong???
Once you have started the emulator try
adb devices
to check if you can see it
List of devices attached
emulator-5554 device
then you can proceed with the install
adb install <path-to>/newApp.apk
Something looks strange about that path. If the apk is in the same directory you are launching the command from then you don't need that '/'. If this is a linux machine it would be './' for the same directory unless your apk is all the way up on root but that would be bad :)

App will not start on phone. Using Ubuntu 11.10

I am having a lot of trouble trying to get my computer to run an android app on my phone. My computer is running Ubuntu 11.10 and my phone is HTC Desire running 2.2. Here is the error I am getting in Console in Eclipse:
[2011-12-13 19:35:05 - InitialChoice2] Re-installation failed due to different application signatures.
[2011-12-13 19:35:05 - InitialChoice2] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-12-13 19:35:05 - InitialChoice2] Please execute 'adb uninstall com.android.taskreminder' in a shell.
[2011-12-13 19:35:05 - InitialChoice2] Launch canceled!
I have tried renaming the package but have just gotten the same error. My phone is also in HTC Sync mode and I have tried changing that around. I have tried to open the adb shell but to no avail. I am a bit confused how to use it in linux and when I navigate to the directory in Terminal that the adb is located in, I get another error that says it does not recognize adb command. I suppose I am not sure how to execute "adb uninstall com.android.taskreminder" properly. Any help is really appreciated.
try to uninstall it from your phone. go to "Settings" > "Applications" > "Manage Applications" Look for the application name. Select it. There should be an option to uninstall it.
if you want to use adb in a shell, try sudo adb....
Try uninstalling the application through the phone first. This error is usually when you have installed the application in two different ways, so it has a different development signature so cannot update or reinstall.

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