zoukankan      html  css  js  c++  java
  • macOS 配置 adb 和 Android Studio 配置夜神模拟器

    一、macOS 配置 adb

    1. 方法一:使用 Android Studio 自带的 adb 配置

      ① $ touch .bash_profile

      ② $ open -e .bash_profile

      在打开的文件添加如下两行:

        export PATH=${PATH}:~/Library/Android/sdk/platform-tools

        export PATH=${PATH}:~/Library/Android/sdk/tools

      ③ 查看 adb

      $ adb
      Android Debug Bridge version 1.0.39
      Version 0.0.1-4500957
      Installed as ~/Library/Android/sdk/platform-tools/adb

    2. 方法二:通过终端 breview 配置

      ① 安装

      $ brew cask install android-platform-tools

      最后显示 android-platform-tools was successfully installed! 说明安装成功。

      ② 查看 adb

      $ adb
      Android Debug Bridge version 1.0.41
      Version 29.0.4-5871666
      Installed as /usr/local/bin/adb

      ③ 卸载

      $ brew cask uninstall android-platform-tools

      ==> Uninstalling Cask android-platform-tools
      ==> Unlinking Binary '/usr/local/bin/adb'.
      ==> Unlinking Binary '/usr/local/bin/dmtracedump'.
      ==> Unlinking Binary '/usr/local/bin/etc1tool'.
      ==> Unlinking Binary '/usr/local/bin/fastboot'.
      ==> Unlinking Binary '/usr/local/bin/hprof-conv'.
      ==> Unlinking Binary '/usr/local/bin/mke2fs'.
      ==> Purging files for version 29.0.4 of Cask android-platform-tools

    二、macOS Android 使用 夜神模拟器

    1. 下载并安装 夜神模拟器 https://www.yeshen.com

    2. 在命令行 切换到夜神模拟器 安装目录

      $ cd /Applications/LocalSetup/Nox App Player.app

    3. 连接

      $ adb connect 127.0.0.1:62001

      等待显示 connected to 127.0.0.1:62001 则表示成功。

      

      $ adb connect 127.0.0.1:62001

      already connected to 127.0.0.1:62001

      再次确认已经连接上了。

    附录:macOS Android 环境变量

    1. 路径查看:
    ① AndroidStudio:
    菜单栏 AndroidStudio > Preferences > Appearences&Behavior > System Settins > Android SDK 选项卡中的 SDK Location。

    ② Eclipse:
    菜单栏 Eclipse > Preferences > Android 选项卡中的SDK Location

    2. 环境变量

    Android_HOME:即配置 SDK的根路径.
    PATH:PATH环境变量增加 tools、platform-tools、build-tools 路径。

    示例如下:

    export ANDROID_HOME=/Users/uc/Library/Android/sdk
    #export ANDROID_HOME=/Users/uc/Library/Android/sdk4eclipse

    export PATH=$PATH:$ANDROID_HOME/tools
    export PATH=$PATH:$ANDROID_HOME/platform-tools
    export PATH=$PATH:$ANDROID_HOME/build-tools

    时常一个人发呆,看到宁静的天空。
  • 相关阅读:
    the process cannot access the file because it is being used by another process
    SharePoint 2013: The "New Web Application" button is disabled is the central administration
    【转】Windows按键消息—虚拟键码
    【转】windows消息16进制对应表
    C#将图片字节流转为Base64直接放入html的img标签src属性中
    WPF自定义Main函数
    c#geckofx文件流下载
    腾讯RTX登录提示失败问题及处理办法
    C# \u8888类型的unicode转换为字符串方法
    C#System.Net.Mail采用简单邮件传输协议发送邮件
  • 原文地址:https://www.cnblogs.com/pinweyshg/p/11691252.html
Copyright © 2011-2022 走看看