开发者

How do i tell if i'm in the debugger under android?

开发者 https://www.devze.com 2023-02-06 13:58 出处:网络
I need a way开发者_JAVA技巧 to check whether or not my android app is currently being debugged (there\'s a condition we check for on startup that I specifically do -not- want to check when the debugge

I need a way开发者_JAVA技巧 to check whether or not my android app is currently being debugged (there's a condition we check for on startup that I specifically do -not- want to check when the debugger is running). Does such a beast exist?


You need to look at isDebuggerConnected.

But it is considered a very bad practice to make your application's behavior dependent on whether debugger connected or not. This may lead to some hard to catch bugs. So be careful.


I can use android.os.Debug's isDebuggerConnected and waitingForDebugger methods to catch this state.

0

精彩评论

暂无评论...
验证码 换一张
取 消