This article transferred from: http://www.cnblogs.com/nbkhic/p/3806951.html
Sometimes in Appium desired capabilities you need to specify the appactivity of the app under test, the following method may help you.
Method One
If you have to test the project source code, then directly view the source code is good. If not, then please contact the source of the students, this is the recommended method.
Method Two
If you don't have the code, you can decompile the app.
There will be 2 tools, Dex2jar and Jd-gui, respectively. Here you can download the latest version as well as the sample apk.
We take the contactmanager.apk in the toolkit as an example and briefly describe the process of anti-compilation.
- 1, rename contactmanager.apk to Contactmanager.zip and unzip to get file Classes.dex;
- 2, unzip the Dex2jar-0.0.9.15.zip and enter the folder from the command line;
- 3, Run command
Get Classes-dex2jar.jar under the current folder;
- 4, decompression jd-gui-0.3.6.windows.zip get file Jd-gui.exe;
- 5, open Classes-dex2jar.jar with Jd-gui.exe;
Well, well, you can enjoy it.
The contactmanager shown here is the main activity of the app under test.
Method Three
Refer to this post in Testerhome
Use log to view Dafa (well, no grep on Windows is not happy, fortunately there are PowerShell select-string, can be used to force a use), directly to move bricks.
A. Launch the apk you want to test
b, turn on the log output: adb logcat>d:/log.txt
C, turn off the log output: Ctrl + C
D. View Logs
Find:
Displayed Com.mm.android.hsy/.ui. Loginactivity: +3s859msapppackage = com.mm.android.hsyappActivity =. UI. Loginactivity
Well, the preparation activity is almost done. The next section of ethanol takes you on a journey of control positioning.
The copyright of this article is owned by ethanol, welcome reprint, but please specify the author and source, strictly prohibited for any commercial use
Monkey Test = = = How to get activity for Android app