mac os 用真机调试android应用

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

 

1,设置adb的环境变量

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

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

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

2,查看设置是否生效

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

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

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文件不存在,新建这个文件

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

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

7,现在可以在android studio工具里面使用设备调试了。  

 

posted @ 2016-04-30 22:48  木鱼长老  阅读(1672)  评论(0编辑  收藏  举报