adb 连接手机失败

来源:互联网 发布:电商seo是什么意思 编辑:程序博客网 时间:2024/04/27 20:37
刚开始认真的静下心来,来好好的看下Android开发,结果刚写了第一个,就遇到这个错误:

Run as Android Application时系统提示"No compatible targets were found. Do you wish to add new Android Virtual Device?"
Google了一下,解决方法如下:
打开“我的电脑”找到android-sdk的tools路径。我的在D:/android-sdk/tools下。
然后开始-cmd进入这个路径下输入android create avd –t 2 –n Android123    然后回车就行。(基本上执行这个就可以了)

-------

-------

 

Created AVD 。。。。。

到这里就OK了

 


相关说明:

   Action "create avd":  Creates a new Android Virtual Device.


   Options:
  -t --target   Target id of the new AVD [required]
  -c --sdcard   Path to a shared SD card image, or size of a new sdcard for the new AVD
  -p --path     Location path of the directory where the new AVD will be created
  -n --name     Name of the new AVD [required]
  -f --force    Force creation (override an existing AVD)
  -s --skin     Skin of the new AVD


PS:
这个问题最主要的原因还是项目版本与创建的模拟器(AVD)版本不一样造成的, 有时候我们把之前建那的模拟器删除了,那你再次建好模拟器的时候,运行程序时有可能会提示No compatible targets were found, Do you wish to a add new Android Virtual Device 如果你建的和之前项目用的版本一样的话,就不会有这个错。

总结一下SDK版本和项目版本的问题,如果你建的项目是高版本的话,你是部署不到以下版本建立的AVD上的,所以,可以用1.6版本作为开发建项目 1.6以上建的AVD都有效果, 另一种方法就是多创建几个不同版本的AVD,这样不同版本的项目就可以在不同的AVD上运行而不会出现此错误了。
0 0
原创粉丝点击