Using Robotium to test apk file
This tutorial is for testing an apk file if you dont have the source.
Follow this first if app is not yours and is signed by someone else.
1. Open the apk file with 7zip or any other alternative.
2. Delete the Meta-inf folder.
3. Resign the apk again in debug mode.
If the app is yours.
Export the app in any location signed in debug mode.
Install the apk onto the emulator.
Now again create a test project like in the 1st post.
Make sure you click the radio button for ''This Project''.
From now, its similar to the first post.
First right click on the package and go to New> Package
and give the package as com.testcalculator
Create a new Class by right clicking on the Test Project and name it as TestApk
Again add the Robotium jar file that you downloaded earlier. Follow first post on how to do it.
Finally right-click the project and run it as Android JUnit Test.
That's it. Emulator will load it and test it the same way as in Post 1.
1. Make sure your Manifest is correct because most probably Eclipse will make the package as com.calculator.test . You can keep it the same way but to differentiate it from the 1st post, we will keep it as com.testcalculator .
2. Whatever your package name is, make sure to keep it correct in the java class in src folder.
3. You can keep the java file same as in post 1 keeping in mind the above point.