adb 连接手机失败

刚开始认真的静下心来,来好好的看下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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值