码迷,mamicode.com
首页 > 其他好文 > 详细

apk的安装删除

时间:2015-02-26 18:13:07      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:

1,签名:

java -jar signapk.jar platform.x509.pem platform.pk8 DownloadProvider.apk DownloadProvider-sign.apk

2,

adb connect 192.168.12.103

adb remount

 

3,apk安装(可以用adb push直接放置目录即可;或者用adb install):

  adb push DownloadProvider.apk /data/app

  adb install -f xxx.apk

  adb uninstall apk的包名 或者 直接删除 rm

4,启动activity:

  root@Hi3798MV100:/ # am start -n com.mozillaonline.downloadprovider/.DownloadProviderActivity

  这是用 包名/.类名

  <manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.mozillaonline.downloadprovider"

  。。。。。

  <activity
    android:name=".DownloadProviderActivity"

 

参考:

adb shell am 的用法

使用此命令可以从cmd控制台启动 activity, services;发送 broadcast等等:
 
C:\Users\Administrator>adb shell am
usage: am [subcommand] [options]

    start an Activity: am start [-D] [-W] <INTENT>
        -D: enable debugging
        -W: wait for launch to complete

    start a Service: am startservice <INTENT>

    send a broadcast Intent: am broadcast <INTENT>

    start an Instrumentation: am instrument [flags] <COMPONENT>
        -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
        -e <NAME> <VALUE>: set argument <NAME> to <VALUE>
        -p <FILE>: write profiling data to <FILE>
        -w: wait for instrumentation to finish before returning

    start profiling: am profile <PROCESS> start <FILE>
    stop profiling: am profile <PROCESS> stop

    start monitoring: am monitor [--gdb <port>]
        --gdb: start gdbserv on the given port at crash/ANR

    <INTENT> specifications include these flags:
        [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
        [-c <CATEGORY> [-c <CATEGORY>] ...]
        [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
        [--esn <EXTRA_KEY> ...]
        [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
        [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
        [-n <COMPONENT>] [-f <FLAGS>]
        [--grant-read-uri-permission] [--grant-write-uri-permission]
        [--debug-log-resolution]
        [--activity-brought-to-front] [--activity-clear-top]
        [--activity-clear-when-task-reset] [--activity-exclude-from-recents]
        [--activity-launched-from-history] [--activity-multiple-task]
        [--activity-no-animation] [--activity-no-history]
        [--activity-no-user-action] [--activity-previous-is-top]
        [--activity-reorder-to-front] [--activity-reset-task-if-needed]
        [--activity-single-top]
        [--receiver-registered-only] [--receiver-replace-pending]
        [<URI>]
 
 
使用实例:
如启动一个 Activity:
 
格式:
adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。
 
实例1:
C:\Users\Administrator>adb shell am start -n com.android.camera/.Camera
Starting: Intent { cmp=com.android.camera/.Camera }
 
实例2:(带extra 的 intent)
C:\Users\Administrator>adb shell am start -n com.android.camera/.Camera -e thisKey thisIsValue
Starting: Intent { cmp=com.android.camera/.Camera (has extras) }
其中 extra 的 key 为 abc ,value 为字串 "hello"
 
还可以发送命令模拟手机低电环境:

实例:

adb shell am broadcast -a android.intent.action.BATTERY_CHANGED --ei "level" 3 --ei "scale" 100

 

Android中adb push和adb install的使用区别

技术分享 Dreamtale 2014-03-10 23:41:44

apk的安装删除

标签:

原文地址:http://www.cnblogs.com/bigben0123/p/4301520.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!