Mac电脑上使用安卓adb局域网安装apk
一、MAC 电脑安装adb工具
1、通过homebrew安装adb工具
1> 打开终端,输入/bin/bash -c "$(curl-fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”
(注:需使用外网,或者使用国内镜像/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”
)
2>根据后续提示继续操作 (点击Enter和输入电脑密码);直到显示Installation successful!,则homebrew安装完成;
3>使用homebrew安装adb,在终端输入brew install --cask android-platform-tools
XXXXMac ~ % brew install --cask android-platform-tools
==> Downloading https://dl.google.com/android/repository/platform-tools_r34.0.4-
######################################################################### 100.0%
==> Installing Cask android-platform-tools
==> Linking Binary ‘adb’ to ‘/usr/local/bin/adb’
==> Linking Binary ‘dmtracedump’ to ‘/usr/local/bin/dmtracedump’
==> Linking Binary ‘etc1tool’ to ‘/usr/local/bin/etc1tool’
==> Linking Binary ‘fastboot’ to ‘/usr/local/bin/fastboot’
==> Linking Binary ‘hprof-conv’ to ‘/usr/local/bin/hprof-conv’
==> Linking Binary ‘make_f2fs’ to ‘/usr/local/bin/make_f2fs’
==> Linking Binary ‘make_f2fs_casefold’ to ‘/usr/local/bin/make_f2fs_casefold’
==> Linking Binary ‘mke2fs’ to ‘/usr/local/bin/mke2fs’
🍺 android-platform-tools was successfully installed!
显示如上图则adb安装完成;或使用终端指令adb devices 查看是否争取安装
二、开启Android设备对应配置
1>打开开发者模式
2>打开adb调试
3>如弹出“允许USB调试吗”,选择允许
三、指令设置
1>开启adb服务,在终端输入adb start-server
回车
2>在局域网中连接Android设备
终端输入指令adb connect 192.168.x.x:5555
XXXMac ~ % adb connect 192.168.x.x:5555
connected to 192.168.x.x:5555
**注:**这里的IP地址为安卓设备的IP地址
3>查询连接设备
终端输入adb devices
XXXMac ~ % adb devices
List of devices attached
192.168.x.x:5555 device
**注:**如果显示192.168.x.x:5555 unauthorized 则为安卓设备未授权,即没有允许USB调试授权;这是需要找到该权限重新授权;如果是电视则需要重启电视后自动弹出“允许USB调试吗”,选择允许。每次重启设备后需要查看adb调试权限是否打开
4>安装需要的软件
终端输入adb install apk路径
如:adb install /Users/xx/Desktop/tvx.apk
XXXMac ~ % adb install /Users/xx/Desktop/tvx.apk
Performing Push Install
/Users/xx/Desktop/tvx.apk: … 0.5 MB/s (22288929 bytes in 45.077s)
pkg: /data/local/tmp/tvx.apk
Success
出现如上所示则apk成功传输到Android设备,此时可以再Android设备上点击安转apk文章来源:https://www.toymoban.com/news/detail-830744.html
5>关闭adb服务
终端输入adb kill-server
回车文章来源地址https://www.toymoban.com/news/detail-830744.html
到了这里,关于Mac电脑上使用安卓adb局域网安装apk的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!