mirror of
https://github.com/appium/appium.git
synced 2026-02-09 19:28:48 -06:00
Android's uiautomator has a broken long click implementation. uiautomator will not pause long enough on long click which causes Android to detect the long click as a normal click. This fix uses reflection to access uiautomator's private touchDown/touchUp methods to reimplement longClick correctly. In theory I should be able to obtain a reference to android.app.UiAutomation without using reflection. However this doesn't seem possible when using uiautomator. getInstrumentation().getUiAutomation(); doesn't work because we're not using instrumentation.
Bootstrap Android
To install the Android Maven dependencies in your local environment, run the following:
- Clone https://github.com/mosabua/maven-android-sdk-deployer into your workstation
- Set the ANDROID_HOME environment to the location of the Android SDK, eg.
export ANDROID_HOME=/Developer/adt-bundle-mac-x86_64-20130219/sdk/ - Run
mvn install -P 4.3from themaven-android-sdk-deployerdirectory. The build will fail if API 18 and some extra packages are not installed.
You can then compile the bootstrap project by running
mvn package -P 4.3
If mvn package fails, try deleting your ANDROID_HOME folder and downloading everything again. If it still doesn't work try:
android-sdk/tools/android update sdk --no-ui --obsolete --force
and then run mvn clean ; mvn install