美文网首页
常用命令

常用命令

作者: Yanqilong | 来源:发表于2017-09-07 09:01 被阅读70次

    上一篇文章讲了Android Things Wi-Fi连接到开发板,不明白的请查看http://www.jianshu.com/p/08f6785ff5aa

    查看adb可以连接的设备

    adb devices
    

    有多个设备时连接到指定设备

    adb -s <设备名称> shell
    

    备注:<设备名称>通过命令adb devices查看

    进入设备终端

    adb shell
    

    上一节中有些命令带上adb shell前缀才能执行,如果先通过命令adb shell进入设备终端执行命令,则可以省去这些前缀

    连接到设备

    adb connect <IP>
    

    <IP>参数为IP地址

    连接到指定Wi-Fi

    adb shell am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid <network_SSID> -e passphrase <network_passcode>
    

    <network_SSID>参数为Wi-Fi名称
    <network_passcode>参数为Wi-Fi密码

    清除已连接wifi配置

    adb shell am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Reset
    

    启动应用

    adb shell am start -n <packageName>/<activity>
    

    <packageName>参数为包名
    <activity>参数为要启动的类

    停止应用

    adb shell am force-stop <packageName>
    

    <packageName>参数为包名

    查看已安装应用

    adb shell pm list packages
    

    卸载应用

    adb uninstall <packageName>
    

    <packageName>参数为包名

    相关文章

      网友评论

          本文标题:常用命令

          本文链接:https://www.haomeiwen.com/subject/xovbjxtx.html