Friday, November 23, 2012

Re: Aplikasi app Malaysia

http://www.appinventor.org/android-emulator

Android Emulator: Installing and Using






This page is deprecated. The emulator is now a built-in part of App Inventor

Android provides an emulator so you can test apps on a virtual phone
without downloading them to an actual Android device. App Inventor's
interactive testing process works with the emulator. Instead of
connecting a phone using the USB port, just start up an emulator and
then click "Connect to Phone" from the App Inventor Blocks Editor.
Your app will load in the emulator and you can test it from there.

You'll need to download the Java Android SDK to use the emulator.
Instructions are below:


Downloading the Java Android SDK and the Emulator
1. Download the Android SDK on to your computer.
http://developer.android.com/sdk/index.html


Think you already have it? Open a terminal and type "android". If it's
there, the Android SDK and AVD Manager will appear. Skip down to 5.







2. Place the android SDK in a suitable location (e.g., /Applications on the Mac)

3. You may need to change your path. Here's one way to do it:




open .bash_profile in your home directory (or create if it doesn't exist)



Add the following line:

export PATH=${PATH}:/Applications/android-sdk-mac_86/tools




(assuming SDK folder is named android-sdk-mac_86 and its in /Applications)




At a terminal, enter "source .bash_profile". This will run the
export command.





4. From a terminal, enter "android" to open the Android SDK and AVD Manager.




5. In the manager, choose "Available Packages" and select the 1.6
version and any others you want. These downloads are a bit slow so you
may not want to download all of them.





6. In Virtual Devices, click new and name the new avd "basic". Select
one of the targets that appear.




7. Choose a virtual device and click Start to run the emulator.


Testing an App Inventor app with the emulator
1. Disconnect any phones from your computer.
2. In the App Inventor Blocks Editor, choose "Connect to Phone". Your
app should appear within the emulator within 30-40 seconds.


Download and running an app in the emulator
1. In the App Inventor Designer, choose Package for Phone |
Download to Computer


Download the app to your computer. This will create a file with the
extension .apk (an android package).


b. Open a different terminal window than the one that started the
emulator and run the install command. If you downloaded the app (.apk
file) into the Downloads folder, you'll type:

adb install -r Downloads/Purr.apk

c. Be careful the second time you download the same app-- on some
systems it will be given a different name such as Purr(2).apk. The abd
install program doesn't allow parenthesis in file names, so you'll
probably want to rename it on your computer before installing it on
the emulator.




Old command-Line method of creating avds

These instructions are for the emulator that comes with the older
version of the SDK (1.5x).
An AVD is an emulator instance for a particular version (e.g., 1.6) of
the phone.

Enter the commands below in the terminal:


android list targets


This will show you a numbered list of the 'targets' that come as part
of your sdk. For me, android 1.5 came as #2.

android create avd -n basic -t 2

This creates an AVD named 'basic'. The "2" corresponds to the target.

You only need to do the above commands once, to create your virtual device.



Old Start up the emulator:

emulator -avd basic

No comments:

Post a Comment