Android unit test best practices 1: Build the android studio test environment and android Best Practices
Before using android studio for unit testing, you must install the plug-in for unit testing: android-studio-unit-test-plugin.
Press the shortcut key (alt + ctrl + S) to enter setting and select plugins.
But here you will find a small problem. The installation of plug-ins in android studio is extremely slow. Maybe you cannot even see the content of the remote library? Because you have been attacked by the wall, you certainly use the goagent to overturn the wall. If you have not installed the goagent, go here: Ghost. Start the goagent agent after installation:
Set the android studio Internet proxy: press the shortcut key (Alt + Ctrl + S) to enter setting ---> gradle ---> Gradle VM Options
-Dhttp. proxyHost = fig-Dhttp. proxyPort = 8087
After the setting is successful, restart androidstudio. The speed will be very fast.
After successful installation:
Introduction to robolectric