一步一步学习Android TV/盒子开发(二)

TV、机顶盒开发调试不能像手机一样通过USB线连接调试,可通过ADB连接调试

连接电视

adb connect 10.74.84.199
  • 1
  • 2

连接成功

连接后就可以开始开发调试了!

断开连接

// 断开某个设备
adb disconnect 10.74.84.199
  • 1
  • 2
  • 3

断开连接

// 断开所有设备
adb disconnect
  • 1
  • 2
  • 3

断开连接

常用的ADB命令

查看连接设备信息

adb devices
  • 1
  • 2

安装APK

adb install apk全路径(可直接拖拽apk文件到CMD窗口)
  • 1
  • 2

卸载应用

adb uninstall 包名
  • 1
  • 2

申请root权限

adb root // 执行完该命令一般需要重新连接一下设备
  • 1
  • 2

推APK到系统APP目录下

adb push < apkfile > /system/app/        (需要root权限)
  • 1
  • 2

进入shell

adb shell 

以下是开发中常用到shell命令

让整个系统文件有权限操作

mount -o remount /system
或者退出shell
adb remount

启动应用

adb shell am start -n "com.jade.test/com.jade.test.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

am start -n com.jade.test/com.jade.test.MainActivity

以上是开发中常用到的命令,更多命令可以通过一下多多学习。

猜你喜欢

转载自blog.csdn.net/weixin_40441128/article/details/82150129
今日推荐