Some possible Appium Server bugs? Some processes are run twice when installing and launching an app

I spent the last few weekends reviewing the server logs for Appium 1.6.4 and went through them all, line-by-line, after simply having Appium launch and install an Android app on an emulator. I found a few possible bugs that I highlighted in red on http://www.tjmaher.com/2017/06/behind-the-scenes-install-launch-appium.html

I’m not sure which are bugs or not. I was wondering if anyone experienced with Appium could review it? Thank you very much!

snip

[ADB] Getting package info for io.appium.settings
[ADB] Getting connected devices...
[ADB] Checking whether aapt is present
[ADB] Using aapt from /Users/ventmahe/Library/Android/sdk/build-tools/23.0.1/aapt
[ADB] 1 device(s) connected
[ADB] Running '/Users/ventmahe/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","dumpsys","package","io.appium.settings"]
[ADB] Cannot read version codes of /Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk and/or io.appium.settings. Assuming correct app version is already installed

Hrm… settings_apk-debug.apk and/or io.appium.settings could not be found. I don’t think I set up anything special. Maybe they can’t be found because they are not there?

In another section…

snip

[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running '/Users/ventmahe/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]
[ADB] Running '/Users/ventmahe/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";"]

… We seem to be granting permissions to settings twice in a row?

snip

[ADB] Running '/Users/ventmahe/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","install","/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[ADB] Running '/Users/ventmahe/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","install","/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[ADB] Application '/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk' already installed. Continuing.

… Again, we are installing things twice in a row…

snip

[UiAutomator] UiAutomator shut down normally
[UiAutomator] Moving to state 'stopped'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running '/Users/ventmahe/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","emulator-5554","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[UiAutomator] Moving to state 'stopped'

… And again, there is the duplication…

-T.J. Maher

3 Likes

I am having the exact same situation.
Once automated test finish running without any problem, it will start all over again.

2 Likes

Hi,
Not sure if you still trying to figure out about this but I found a reason for this repetition.
I was using
$ ./gradlew test
to run appium test, however, this will run test for all the build types. In my case, there are bebug and release build so it was running twice.
To run test for specific build, command as following
$ ./gradlew testDebug
OR
$ ./gradlew testRelease
It worked for me :slight_smile:

If this is still happening with latest appium server version, will be good to open issue in appium github repo