top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

How to avoid my app being debugged on android emulator ?

+1 vote
105 views

I found that most released apps(including system apps) can be debugged on the emulator by the way following:
1. install the app on the emulator, and launch it
2. run adb shell ps to get the pid of the app
3. run adb jdwp, if you find the pid in the output, then you can attach to the app by running
adb forward tcp:1234 jdwp:$pid_you_find and jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=1234
4. you can use commands such as "classes" to see the classes of the app, even "stop" to set breakpoint and "eval" to run many functions and see the members of the objects.
I have 2 questions:
1. Why these tricks fail on the phones? What's the difference between the rom of emulator and phones?
2. How to avoid my app being debugged through such way?

posted Aug 23, 2013 by Luv Kumar

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

2 Answers

+1 vote
answer Aug 25, 2013 by Amit Parthsarthi
+1 vote

1) On Emulators, debug or eng builds you have ro.debuggable = 1, which allows all apps to be debugged. on production builds this is set to 0 so to debug an app you have to set it from the app's manifest.
2) you cant, as you cant stop smb decompiling it. if u r afraid of smb sees what u r app does better obfuscate it.

answer Aug 25, 2013 by Majula Joshi
Similar Questions
+1 vote

I have installed my custom app in Packages/apps/

in the app, I use a simple Videoview for video playbacks (3gp or mp4). it works in actual device/ADT emulator, but If I run it in AOSP emulator, it says "Failed to open file : the path of the video"

// Retrieving file from internal file 
systemVideo.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.drawable.test));
+2 votes

I find that the emulator's memory increase rapidly when check GPU on. You can do the reproduction as following:
1. Turn on GPU following http://developer.android.com/tools/devices/emulator.html#acceleration
2. Power on the emulator
3. Launch some apps by mouse, (i,e. launch Settings then Clock, and Settings then Clock ...)
4. Check the memory usage of emulator by top command on Ubuntu and ProcessExplorer on Windows

I found that the apps with property android:hardwareAccelerated="true" is more worse.

+1 vote

How can we debug the Android framework Java code? i know how I can debug the c/c++ code with the help of GDB server etc, but I searched a lot on Google but did not get the solution, currently i am totally relying on Logs but I really need something to Debug the java code inside framework and etc?
please give me some pointers or some details about debugging AOSP framework java code?

+1 vote

Can any one please guide me to debug Android code. I tried to use GDB and GDBServer for this but couldn't succeed.


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#470/147, 3rd Floor, 5th Main,
HSR Layout Sector 7,
Bangalore - 560102,
Karnataka INDIA.
QUERY HOME
...