The Android Emulator provide a powerful way to test Android applications. But it not allow you to test root apps because you can't get root privileges via su on the Emulator, although it's possible via adb shell.
So if you want to test root apps you have to get a rooted emulator. It's mean a su binary and optionally the superuser app which allow you to manage root apps.
Here is the list of commands you have to run while the emulator is running :
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
adb push su /system/xbin/su
adb shell chmod 06755 /system
adb shell chmod 06755 /system/xbin/su
It assumes that the su binary is located in the working directory. You can find su and superuser here : http://forum.xda-developers.com/showthread.php?t=682828.
You need to run these commands each time you launch the emulator. You can write a script that launch the emulator and root it.
To install superuser persistently :
adb install superuser.apk
[Update April 2012] : This tip doesn't work anymore, see comments for more information
Was very useful, thank you
ReplyDeleteThank you for sharing !
ReplyDeleteHi there..! It's all fine. That commands shows no error. But, when i tried to install shootme apk(which needs root access) has installed successfully,But it is not running in my emulator and it show that Need root access to run this application. How can i determine that my emulator is rooted..?
ReplyDeleteHi,
DeleteWhat you have done should work. But I test it today and it doesn't work anymore.
The only diference between my today's test and when I used this tip in May 2011 is the sdk version (which is different from the Android version). Back in May 2011 I guess I used the sdk r9 or r10 (my current version is r18).
For the record, with which version of the SDK do you try and what is the AVD Android version ? For me it's sdk r18 and AVD 2.1 and 2.3.3.
If you have the time you can test this :
1) Download a previous sdk version (ideally r9 or r10)
2) Download the package for Android 2.1 or 2.2.
3) Create a new AVD 2.1 or 2.2
4) Run the newly created AVD
5) Perform the described steps
6) Install your APK and test it
Ping me if you have more informations on this issue.
This works for me:
Delete- sdk rev 18
- avd target: Android 2.3.3 (API level 10)
Deleteadb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
adb push su /system/xbin/su
adb shell chmod 06755 /system
adb shell chmod 06755 /system/xbin/su
where should i check these commands.when i tried it in cmd,command doesn't finish executed.
I have been intelligent for hours and I haven't gone through such awesome stuff.
ReplyDeletenews
Wasp dudes! Awesome stuff keep it up.
ReplyDeleteandroid rooted apps
I really enjoy while I read your blogs and articles.
ReplyDeletecheck out the post right here
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete
ReplyDeleteI’m glad to locate so much of informative data in your blog.
Us Technical Support
When I use command print occurs error
ReplyDelete9Apps Apk
ReplyDelete360 Root Apk
GBWhatsApp Apk
GetApk Market Apk
Lulubox Apk
whenever you face issues with router router then you can cantact experst at +1-888-846-5560 to get Netgear router support.
ReplyDeleteWhenever you face any kind of issue while using PayPal then you can dial +(1)-877-207-4415 PayPal Support Number. Our experts will resolve your issues instantly.
ReplyDeleteAre you troubling with your ms office issues?. If yes then you don't need to worry about it just call experts at +(1) 844 489 7268 Microsoft office support number.
ReplyDeleteNice Post 12 Minute Affiliate System
ReplyDelete