1,apk要实现程序自启动?
2,adb命令安装使用。
apk要设置程序自启动,
a,首先要给清单权限,获取安卓权限。
b,设置程序默认欢迎页配置。
c,设置为系统程序,加入系统启动。
AndroidManifest.xml清单文件:
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="/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" /><applicationandroid: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调试工具)
链接:/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