mac os 用真机调试android应用

首先,要安装filetransfer.dmg程序,才能把android机链接到mac os上面android

 

1,设置adb的环境变量shell

  查找android tools所在的目录,在android tools下面有adb工具,目录以下“/Users/fenghewei/Android/Android_tools/android-sdk-macosx/platform-tools”,把这路径加入到~/.bash_profile文件中macos

#adb
ANDROID_ADB=/Users/fenghewei/Android/Android_tools/android-sdk-macosx/platform-tools
export PATH=$PATH:$ANDROID_ADB

执行:source ~/.bash_profile让文件当即生效bash

2,查看设置是否生效工具

  ~ adb version
Android Debug Bridge version 1.0.32
Revision 09a0d98bebce-android

3,连接手机,把手机的链接方式设置为"内置光盘"的模式。ui

4,system_profiler SPUSBDataType 找到设备的Vendor ID
调试

M81:
          Product ID: 0x0c03
          Vendor ID: 0x2a45
          Version: ff.ff
          Serial Number: 810EBMA3U25H
          Speed: Up to 480 Mb/sec
          Manufacturer: Meizu
          Location ID: 0x14100000 / 15
          Current Available (mA): 1000
          Current Required (mA): 500
          Extra Operating Current (mA): 0
          Capacity: 14.3 MB (14,297,808 bytes)
          Removable Media: Yes
          Detachable Drive: Yes
          BSD Name: disk4
          Partition Map Type: Unknown
          Volumes:
            iAmCdRom:
              Capacity: 3.1 MB (3,110,912 bytes)
              Available: Zero KB
              Writable: No
              File System: ISO Joliet
              BSD Name: disk4s0
              Mount Point: /Volumes/iAmCdRom
              Content: CD_ROM_Mode_2_Form_1

5,将vendor ID加入到~/.android/adb_usb.ini文件中,若是adb_usb.ini文件不存在,新建这个文件code

6,在开发人工具里面使能"USB调试",并重启adb服务orm

➜  ~ adb kill-server
➜  ~ adb devices
List of devices attached
810EBMA3U25H	device

7,如今能够在android studio工具里面使用设备调试了。  server

相关文章
相关标签/搜索