Application之属性debuggable

会看到有人说只有当你把application中的debuggable设置为true的时候,才可以在机器上进行调试,如果不设置的话,默认为false。

今天楼主尝试了下,这句话是错的。

我新建了个程序,并且没有设置debuggable该属性,即它为false,楼主将他安装在手机上,并设置断点,发现依旧可以调试。

有人说这是因为系统中的一个属性叫ro.debuggable值为1,所以默认所有应用程序都是可以调试的,所以不管应用程序中的debuggable为何值。但是我在命令行中看了下该值,发现该值为0,现在楼主呵呵了。


后来我就去androidManifest中去设debuggable的值,发现报错:


中间黄色框的话是这样子的:

Avoid hardcoding the debug mode, leaving itout allows debug and release builds to automatically assign one.

It is best to leave out theandroid:debuggable attribute from the manifest. If you do, then the tools willautomatically insert android:debuggable=true when building APK to debug on anemulator or device. And when you perform a release build such as Exporting APK,it will automatically set it to false.

If on the other hand you specify a specificvalue in the manifest file, then the tools will always use it. This can lead toaccidentally publishing your app with debug information.

现在大家应该懂了吧,这段英文我就不翻译了,我的语文比较差 快哭了 快哭了 快哭了 快哭了

所以呢在Android中如果不设置debuggable,他默认是可调试的,即为true。但是如果你发布的是一个Release版本,那么它又会默认为false。


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值