appium/appium-uiautomator2-server

uninstall io.appium.uiautomator2.server/test Failed

Dor-bl opened this issue · 6 comments

Hi

Suddenly I'm unable to uninstall io.appium.uiautomator2.server for one of my real devices:

steps to repro:
adb -s R5CT83YDZ2M uninstall io.appium.uiautomator2.server
adb -s R5CT83YDZ2M uninstall io.appium.uiautomator2.server.test

Both return an error: Failure [DELETE_FAILED_INTERNAL_ERROR]

Logcat:

--------- beginning of main
03-06 15:14:49.858   785   785 I android.hardware.health@2.1-service-samsung: updateLrpSysfs: write: 253
--------- beginning of system
03-06 15:14:51.613 25186 25300 D ActivityManager: freezing 27493 com.microsoft.appmanager
03-06 15:14:53.021 25512 25711 I TelephonyProvider: D/TelephonyProvider: subIdString = 2 subId = 2
03-06 15:14:53.032 25186 25227 D BatteryExternalStatsWorker: update stats : modem-data (4)
03-06 15:14:53.033 25186 25227 D BatteryExternalStatsWorker: Fetch modem data
03-06 15:14:53.034 25186 25227 D BatteryExternalStatsWorker: Update Rail Energy data
03-06 15:14:53.036 25512 25711 I TelephonyProvider: D/TelephonyProvider: subIdString = 2 subId = 2
03-06 15:14:53.039 25512 25582 I System.out: Broadcasting: Intent { act=com.sec.intent.action.SARDEVICE_CP flg=0x10000000 (has extras) }
03-06 15:14:53.044 25186 25217 W ProcessStats: Tracking association SourceState{5a17faf system/1000 BTopFgs #3516774} whose proc state 2 is better than process ProcessState{a74b28a io.appium.settings/10392 pkg=io.appium.settings} proc state 3 (48 skipped)
03-06 15:14:53.045 25186 25330 D MotionRecognitionService: [SAR]  onReceive : SARDEVICE_CP, callAction = off deviceID = 3 slot = 0 device_ext = 0
03-06 15:14:53.046 25186 25330 I MotionRecognitionService: [SAR] setEndTime workingtime type: 0 : 2390459
03-06 15:14:53.046 25186 25330 I MotionRecognitionService: [SAR] setEndTime screen true, type : 0, device : 0
03-06 15:14:53.046 25186 25330 I MotionRecognitionService: [SAR] id : 0 cmd :off
03-06 15:14:53.046 25186 25330 I MotionRecognitionService: [SAR] SarDevice clear 1 channel : 0 , state : 0
03-06 15:14:53.050 25186 27215 W TelephonyManager: requestModemActivityInfo: Received an invalid ModemActivityInfo
03-06 15:14:53.050 25186 27215 W BatteryExternalStatsWorker: error reading modem stats:ERROR_INVALID_INFO_RECEIVED
03-06 15:14:53.050 25186 25227 D BatteryExternalStatsWorker: mStats lock released
03-06 15:14:53.050 25186 25227 D BatteryExternalStatsWorker: done updateExternalStatsLocked
03-06 15:14:53.053 25512 25711 I TelephonyProvider: D/TelephonyProvider: subIdString = 2 subId = 2
03-06 15:14:53.055 25512 25582 I System.out: Broadcasting: Intent { act=com.samsung.intent.action.BIG_DATA_INFO (has extras) }
03-06 15:14:53.059 25186 25186 I NSLocationMonitor: Broadcast receiver, action=com.samsung.intent.action.BIG_DATA_INFO
03-06 15:14:53.060 25186 25330 D MotionRecognitionService: [SAR] set setTransmitPowerWithFlag  value : 1 : false
03-06 15:14:53.060 25186 25330 I MotionRecognitionService: [SAR] setEndTime workingtime type: 1 : 2387851
03-06 15:14:53.060 25186 25330 I MotionRecognitionService: [SAR] setEndTime screen true, type : 1, device : 0
03-06 15:14:53.060 25186 25330 I MotionRecognitionService: [SAR] SX9380 Grip sensor disableSensor : true
03-06 15:14:53.060 25186 25330 I MotionRecognitionService: [SAR] SX9380 Grip sensorsetTunerGrip 8589934592 , state: false
03-06 15:14:53.065 25512 25512 D SemBigDataInfoController: Intent: com.samsung.intent.action.BIG_DATA_INFO
03-06 15:14:53.065 25512 25512 D SemBigDataInfoController: BIG_DATA insertLog slot: 0, feature: 26
03-06 15:14:53.066 25186 25226 D BatteryStatsImpl: SemModemActivityInfo{ SleepTimeMs=244666 IdleTimeMs=6984 mNr=MobileActivity{ txTimeMs[]=[0, 0, 0, 0, 0] rxTimeMs=0 txBytes=0 rxBytes=0 } mLc=MobileActivity{ txTimeMs[]=[0, 0, 480, 37, 4] rxTimeMs=29873 txBytes=3339 rxBytes=9394 } }
03-06 15:14:53.068 25512 25711 I TelephonyProvider: D/TelephonyProvider: subIdString = 2 subId = 2
03-06 15:14:53.069 25512 25512 D SemBigDataInfoController: Intent: com.samsung.intent.action.BIG_DATA_INFO
03-06 15:14:53.074 25186 25330 D MotionRecognitionService: [SAR] set setTransmitPowerExt  value : 8589934592 : false
03-06 15:14:53.074 25186 25330 I MotionRecognitionService: [SAR] tunerGrip is 8589934592, state : false
03-06 15:14:53.074 25186 25330 I MotionRecognitionService: [SAR] SX9380 Grip sensorsetTunerGrip 17179869184 , state: false
03-06 15:14:53.076 25512 26211 I System.out: Broadcast completed: result=0
03-06 15:14:53.085 25186 25330 D MotionRecognitionService: [SAR] set setTransmitPowerExt  value : 17179869184 : false
03-06 15:14:53.085 25186 25330 I MotionRecognitionService: [SAR] tunerGrip is 17179869184, state : false
03-06 15:14:53.085 25186 25330 D SensorService: Calling activate off 33554443
03-06 15:14:53.086   787   787 I SensorsGrip: [grip_sensor] enable: GripSensor: enable handle = 11 en = 0
03-06 15:14:53.086   787   787 E SensorsGrip: [grip_sensor] enable: mEnabled : 0, first_grip_event : 1
03-06 15:14:53.087 25186 25330 D SensorManager: unregisterListener :: com.samsung.android.gesture.MotionRecognitionSAR$GripSensorWrapper$1@1e791e9
03-06 15:14:53.087 25186 25330 I MotionRecognitionService: [SAR] SX9380 Grip sensor disable channel 0 : 0 , channel 1 : 0
03-06 15:14:53.088 25186 25330 I MotionRecognitionService: [SAR] id : 1 cmd :off
03-06 15:14:53.088 25512 25525 I System.out: Broadcast completed: result=0
03-06 15:14:53.317 27069 28505 I azpt    : (REDACTED) getHotwordActive::active query: %s, watch: %s, devices connected: %s
03-06 15:14:53.741 25186 27215 I PackageManager: START DELETE PACKAGE: observer{47401079}
03-06 15:14:53.741 25186 27215 I PackageManager: pkg{io.appium.uiautomator2.server}, user{0}, caller{2000} flags{2}
03-06 15:14:53.743 25186 25264 D ApplicationPolicy: getApplicationUninstallationEnabled
03-06 15:14:53.743 25186 25264 D ApplicationPolicy: getApplicationUninstallationEnabled :  enabled true
03-06 15:14:53.743 25186 25264 W PackageManager: Not removing non-existent package io.appium.uiautomator2.server
03-06 15:14:53.744 25186 25264 D PackageManager: result of delete: -1{47401079}
03-06 15:14:54.106   576   576 D io_stats: !@   8,0 r 5480742 107410497 w 22353458 247932864 d 6909476 354132624 f 0 1709278 iot 25171236 0 th 0 0 0 pt 0 inp 0 0 7341793.297
03-06 15:14:54.106   576   576 D io_stats: !@ Write_top(KB): kworker/u16:1(7767) 8
03-06 15:14:56.574 25186 25209 E Watchdog: !@Sync: 209981 heap: 106 / 114 FD: 961 [2024-03-06 15:14:56.573]
03-06 15:14:56.600 25186 26770 D FreecessController: com.sec.android.app.sbrowser(10277) is important[!isUidIdle]
03-06 15:14:56.601 25186 26770 D FreecessController: com.samsung.android.calendar(10201) is important[!isUidIdle]
03-06 15:14:53.743 25186 25264 W PackageManager: Not removing non-existent package io.appium.uiautomator2.server

Looks like the package isn't on the device.

Install doesn't work either. How does it work on the end? Isn't it been installed automatically when a session start?
The idea was to uninstall those before each session start to avoid crashes which I read was a solution for the above. But is it even a good approach?

Shouldn't need to manually install or uninstall these, no, unless there's some issue with them. The driver will install them and launch them for you. Could also just run appium driver run uiautomator2 reset instead.

@jlipps Looks like the above command is very useful for my needs.
Closing the issue

@jlipps, Now I have issues again with that device.
I used the suggested command, but this time, it won't help.
https://gist.github.com/Dor-bl/f50962f2500700766b3b3719ab034bb1
Again I see this log:

dbug ADB Running 'C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s R5CT83YDZ2M shell am force-stop io.appium.uiautomator2.server.test'
dbug ADB 'io.appium.uiautomator2.server' is not installed
info ADB io.appium.uiautomator2.server was not uninstalled, because it was not present on the device

Any other suggestions?

maybe try with just one device connected a time? you have 2 devices connected. but the script seems to have run successfully.