Install and delete the apk application in the andriod simulator Environment

Source: Internet
Author: User

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/leilu2008/archive/2009/06/18/4277212.aspx

 

1. Install the android Program

1) Start the simulator, emulator;
2). Use ADB install *. APK to upload the APK file to the data/APP directory of the OS that comes with the simulator;
3). You can open the APK application on the android interface.

2. Delete the Android Application

If you want to uninstall the APK but do not provide the ADB uninstall command, you have to manually delete the APK file in the file system of the simulator operating system to remove it. How to do it? Run ADB shell to enter the operating system of the simulator, and then perform the same operations as Linux: CD Data/APP; RM helloandroid.apk. I will not see this Android app again next time.

[It168 technical documentation] In Android, in addition to starting the program from the interface, you can also start the program from the command line, using the command line tool AM.
The start method is
# Am start-N {package name}/{package name}. {activity name}

The startup method can be obtained from the androidmanifest. xml file of each application. Taking the calculator as an example, its
<? XML version = "1.0" encoding = "UTF-8"?>
<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "com. Android. calculator2">
<Application Android: Label = "@ string/app_name" Android: icon = "@ drawable/icon">
<Activity Android: Name = "Calculator"
Android: theme = "@ Android: style/theme. Black">
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category Android: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
</Activity>
</Application>
</Manifest>

The start method of the calculator is as follows:
# Am start-N com. Android. calculator2/COM. Android. calculator2. Calculator

For the example project helloactivity, androidmanifest. XML is as follows:
<? XML version = "1.0" encoding = "UTF-8"?>
<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"

Package = "com. example. Android. helloactivity">
<Application Android: Label = "Hello, activity! ">
<Activity Android: Name = "helloactivity">
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category Android: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
</Activity>
</Application>
</Manifest>

The startup method is as follows:
# Am start-N com. example. Android. helloactivity/COM. example. Android. helloactivity. helloactivity

Other application startup commands are as follows:

The start method of calendar is as follows:
# Am start-N com. Android. calendar/COM. Android. Calendar. launchactivity

The startup method of alarmclock is as follows:
# Am start-N com. Android. alarmclock/COM. Android. alarmclock. alarmclock

The startup methods of music and video are as follows:
# Am start-N com. Android. Music/COM. Android. Music. musicbrowseractivity
# Am start-N com. Android. Music/COM. Android. Music. videobrowseractivity
# Am start-N com. Android. Music/COM. Android. Music. mediaplaybackactivity

The start method of camera (CAMERA) is as follows:
# Am start-N com. Android. Camera/COM. Android. Camera. Camera

Browser is started as follows:
# Am start-N com. Android. Browser/COM. Android. browser. browseractivity

Generally, an Android Application corresponds to a project. It is worth noting that some projects have multiple activities, while some applications use one project. For example, in the android interface, music and video are two applications, but they all use the packages/apps/music project. The androidmanifest. xml file of this project contains different activities ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.