安卓基于adb命令使用和安装apk程序,程序支持自启动

1,apk要实现程序自启动?

2,adb命令安装使用。

apk要设置程序自启动,

a,首先要给清单权限,获取安卓权限。

b,设置程序默认欢迎页配置。

c,设置为系统程序,加入系统启动。

AndroidManifest.xml清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.instwall.launch">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
    <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:requestLegacyExternalStorage="true"
        android:sharedUserId="android.uid.system"
        android:persistent="true"
        android:theme="@style/AppTheme">
        <activity android:name="com.instwall.launch.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.HOME" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

配置默认欢迎页:

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />

系统apk进程配置:

        android:persistent="true"

cd到 D:\androidSdk\sdk\platform-tools (adb调试工具)

链接:https://pan.baidu.com/s/1VXZig_mDKJ1kT-Ww2CS9ug 
提取码:ga7b

 本地模拟器使用方式:

1,执行adb 连接命令:

adb connect 127.0.0.1:7555  


2,查询当前设备连接信息

 adb devices

3,adb root命令赋予root权限

adb root 

4,adb shell 命令进入到 安卓内部系统存储

5,cd /storage/emulated/0/publisher/ (到文件目录里面)

6,cat查看当前文件里面的内容

/storage/emulated/0/publisher/config/dev.info  代码当前mac地址和ip 和序列号(设备的mac地址需要配置到基础数据里面)

/storage/emulated/0/publisher/play/play.id  (代表当前发布id和播放的视频id)

/storage/emulated/0/publisher/vedio (代表视频存储地址)

/storage/emulated/0/publisher/log(代表程序后台执行的日志)

使用adb命令配置系统app (系统app启动,设置欢迎页,岂可达到程序自启)

授权登录账号

adb root 报错:

重新连接 执行第一步命令。adb connect 192.168.128.114

(出现success或者这个提示就可以了)

系统授权

adb remount

安装到设备大屏为系统程序

adb push D:\app-release.apk /system/app/

 (把当前本地文件推到服务器路径,推送过后关闭显示屏幕,在打开即可使用)

通过adb 命令导出日志到本地查看

adb pull /storage/emulated/0/publisher/log  D:\app.log

 

 (这个日志为java程序写入文件)

其他命令:

查看设备型号

adb shell getprop ro.product.model

查看 Android 系统版本

adb shell getprop ro.build.version.release

清除应用数据与缓存

adb shell pm clear 应用包名

查看应用包名进程:

adb shell ps | findstr com.instwall.launch

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小杨互联网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值