question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UiAutomator2 Could not sign with default certificate.

See original GitHub issue

The problem

Hi, when I set 'automatorName': 'UiAutomator2', there is some problem. According to log:

/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk: Read-only file system

How should I do to solve it?

Environment

  • Appium version (or git revision) that exhibits the issue: 1.9.0
  • Desktop OS/version used to run Appium:Ubuntu 18.04
  • Node.js version (unless using Appium.app|exe):v 8.12.0
  • Mobile platform/version under test:Android 5.0
  • Real device or emulator/simulator:real device
  • Appium CLI or Appium.app|exe: Appium Desktop 1.8.2

This is my code

desired_caps = {
            'platformName': 'Android',
            'platformVersion': '5.0',
            'deviceName': 'SA17806148',
            'appPackage': 'com.android.settings',
            'appActivity': '.Settings',
            'newCommandTimeout': '1000000',
            'automationName': 'UiAutomator2'
        }

Link to Appium logs

This is server log:

[info] [Appium] Welcome to Appium v1.9.1
[info] [Appium] Non-default server args:
[info] [Appium]   sessionOverride: true
[info] [Appium]   relaxedSecurityEnabled: true
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> POST /wd/hub/session
[info] [HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android","appium:platformVersion":"5.0","appium:deviceName":"SA17806148","appium:appPackage":"com.android.settings","appium:appActivity":".Settings","appium:newCommandTimeout":"1000000","appium:automationName":"UiAutomator2"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"5.0","deviceName":"SA17806148","appPackage":"com.android.settings","appActivity":".Settings","newCommandTimeout":"1000000","automationName":"UiAutomator2"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"5.0","deviceName":"SA17806148","appPackage":"com.android.settings","appActivity":".Settings","newCommandTimeout":"1000000","automationName":"UiAutomator2"},null,{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android","appium:platformVersion":"5.0","appium:deviceName":"SA17806148","appium:appPackage":"com.android.settings","appium:appActivity":".Settings","appium:newCommandTimeout":"1000000","appium:automationName":"UiAutomator2"}}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1541640323455 (09:25:23 GMT+0800 (CST))
[info] [Appium] Could not parse W3C capabilities: 'newCommandTimeout' must be of type number
[info] [Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[warn] [BaseDriver] The capabilities ["platformVersion","deviceName","appPackage","appActivity","newCommandTimeout","automationName"] are not standard capabilities and should have an extension prefix
[warn] [Appium] Could not parse fixed W3C capabilities: 'newCommandTimeout' must be of type number. Falling back to JSONWP protocol
[info] [Appium] Creating new AndroidUiautomator2Driver (v1.19.0) session
[info] [Appium] Capabilities:
[info] [Appium]   platformName: Android
[info] [Appium]   platformVersion: 5.0
[info] [Appium]   deviceName: SA17806148
[info] [Appium]   appPackage: com.android.settings
[info] [Appium]   appActivity: .Settings
[info] [Appium]   newCommandTimeout: 1000000
[info] [Appium]   automationName: UiAutomator2
[info] [Appium] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"platformName":"Android","...
[warn] [BaseDriver] Capability 'newCommandTimeout' changed from string ('1000000') to integer (1000000). This may cause unexpected behavior
[info] [BaseDriver] Session created with session id: 4a0e2b8a-7913-4f4e-a9f2-9a22aba2f5bc
[info] [AndroidDriver] Java version is: 1.8.0_181
[info] [ADB] Checking whether adb is present
[info] [ADB] Found 2 'build-tools' folders under '/home/hezj/Software/AndroidStudio/SDK/' (newest first):
[info] [ADB]     /home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2
[info] [ADB]     /home/hezj/Software/AndroidStudio/SDK/build-tools/27.0.3
[info] [ADB] Using adb from /home/hezj/Software/AndroidStudio/SDK/platform-tools/adb
[info] [AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[info] [AndroidDriver] Looking for a device with Android '5.0'
[debug] [ADB] Setting device id to SA17607795
[info] [ADB] Getting device platform version
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 5.0
[info] [AndroidDriver] Using device: SA17607795
[debug] [ADB] Setting device id to SA17607795
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 21
[debug] [ADB] Device API level: 21
[warn] [AndroidDriver] No app sent in, not parsing package/activity
[info] [ADB] Getting device platform version
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.build.version.release'[debug] [ADB] Current device property 'ro.build.version.release': 5.0
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell wm size'[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell wm density'[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.product.model'[debug] [ADB] Current device property 'ro.product.model': M5-53
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.product.manufacturer'
[debug] [ADB] Current device property 'ro.product.manufacturer': alps
[debug] [ADB] Device API level: 21
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell am force-stop io.appium.uiautomator2.server'[debug] [ADB] Checking app cert for /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk
[info] [ADB] Using apksigner from /home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner
[debug] [ADB] Starting '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner' with args '["verify","--print-certs","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk"]'[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: 707bc2493ea5b0267dc10a9bd4cedbab5431976f13274cdd045d93470179556d
[debug] [ADB] Signer #1 certificate SHA-1 digest: b8db0b11cec13cc7574a7d62f383ec16c0d275ee
[debug] [ADB] Signer #1 certificate MD5 digest: 4fcd3b10d1e80a20bbd28758c8a3e19b
[debug] [ADB] WARNING: META-INF/INDEX.LIST not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
[debug] [ADB] WARNING: META-INF/io.netty.versions.properties not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
[debug] [ADB] 
[debug] [ADB] '/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' is not signed with debug cert.
[info] [ADB] Checking whether zipalign is present
[info] [ADB] Using zipalign from /home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/zipalign[debug] [ADB] /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing '/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' with default cert
[debug] [ADB] Starting '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner' with args '["sign","--key","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk"]'[warn] [ADB] Got an error during apksigner execution: Command '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner sign --key /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8 --cert /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' exited with code 1
[warn] [ADB] apksigner stderr: Exception in thread "main" java.nio.file.FileSystemException: /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk: Read-only file system
[warn] [ADB] 	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[warn] [ADB] 	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)
[warn] [ADB] 	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
[warn] [ADB] 	at java.nio.file.Files.move(Files.java:1395)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:342)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
[warn] [ADB] 
[warn] [ADB] Cannot use apksigner tool for signing. Defaulting to sign.jar. Original error: Command '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner sign --key /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8 --cert /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' exited with code 1; StdErr: Exception in thread "main" java.nio.file.FileSystemException: /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk: Read-only file system
[warn] [ADB] 	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[warn] [ADB] 	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)
[warn] [ADB] 	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
[warn] [ADB] 	at java.nio.file.Files.move(Files.java:1395)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:342)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
[warn] [ADB] 
[debug] [ADB] Resigning apk.
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [JSONWP Proxy] Matched '/' to command name 'deleteSession'
[warn] [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell am force-stop com.android.settings'[debug] [ADB] Removing forwarded port socket connection: 8200 
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 forward --remove tcp\:8200'
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 forward --remove tcp\:8200'
[warn] [UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 forward --remove tcp\:8200' exited with code 1'; Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1541640327036 (09:25:27 GMT+0800 (CST))
[debug] [MJSONWP] Encountered internal error running command: Error: Could not sign with default certificate. Original error Command '/usr/lib/jvm/java-8-oracle/bin/java -jar /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk --override' exited with code 1
[debug] [MJSONWP]     at ADB.callee$0$0$ (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:109:13)
[debug] [MJSONWP]     at tryCatch (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [MJSONWP]     at GeneratorFunctionPrototype.invoke [as _invoke] (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [MJSONWP]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [MJSONWP]     at GeneratorFunctionPrototype.invoke (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [MJSONWP]     at run (/tmp/.mount_appiumhI2hjP/app/resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:75:1)
[debug] [MJSONWP]     at /tmp/.mount_appiumhI2hjP/app/resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:92:1
[debug] [MJSONWP]     at flush (/tmp/.mount_appiumhI2hjP/app/resources/app/webpack:/~/babel-polyfill/~/core-js/modules/_microtask.js:18:1)
[debug] [MJSONWP]     at process._tickCallback (internal/process/next_tick.js:61:11)
[info] [HTTP] <-- POST /wd/hub/session 500 3590 ms - 521
[info] [HTTP] 
[info] [HTTP] --> POST /wd/hub/session
[info] [HTTP] {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android","appium:platformVersion":"5.0","appium:deviceName":"SA17806148","appium:appPackage":"com.android.settings","appium:appActivity":".Settings","appium:newCommandTimeout":"1000000","appium:automationName":"UiAutomator2"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"5.0","deviceName":"SA17806148","appPackage":"com.android.settings","appActivity":".Settings","newCommandTimeout":"1000000","automationName":"UiAutomator2"}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"5.0","deviceName":"SA17806148","appPackage":"com.android.settings","appActivity":".Settings","newCommandTimeout":"1000000","automationName":"UiAutomator2"},null,{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android","appium:platformVersion":"5.0","appium:deviceName":"SA17806148","appium:appPackage":"com.android.settings","appium:appActivity":".Settings","appium:newCommandTimeout":"1000000","appium:automationName":"UiAutomator2"}}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1541640327047 (09:25:27 GMT+0800 (CST))
[info] [Appium] Could not parse W3C capabilities: 'newCommandTimeout' must be of type number
[info] [Appium] Trying to fix W3C capabilities by merging them with JSONWP caps
[warn] [BaseDriver] The capabilities ["platformVersion","deviceName","appPackage","appActivity","newCommandTimeout","automationName"] are not standard capabilities and should have an extension prefix
[warn] [Appium] Could not parse fixed W3C capabilities: 'newCommandTimeout' must be of type number. Falling back to JSONWP protocol
[info] [Appium] Creating new AndroidUiautomator2Driver (v1.19.0) session
[info] [Appium] Capabilities:
[info] [Appium]   platformName: Android
[info] [Appium]   platformVersion: 5.0
[info] [Appium]   deviceName: SA17806148
[info] [Appium]   appPackage: com.android.settings
[info] [Appium]   appActivity: .Settings
[info] [Appium]   newCommandTimeout: 1000000
[info] [Appium]   automationName: UiAutomator2
[info] [Appium] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument
[debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {"platformName":"Android","...
[warn] [BaseDriver] Capability 'newCommandTimeout' changed from string ('1000000') to integer (1000000). This may cause unexpected behavior
[info] [BaseDriver] Session created with session id: 757bb414-890c-4b34-bddd-8e156d5b285b
[info] [AndroidDriver] Java version is: 1.8.0_181
[info] [AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[info] [AndroidDriver] Looking for a device with Android '5.0'
[debug] [ADB] Setting device id to SA17607795
[info] [ADB] Getting device platform version
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 5.0
[info] [AndroidDriver] Using device: SA17607795
[debug] [ADB] Setting device id to SA17607795
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 21
[debug] [ADB] Device API level: 21
[warn] [AndroidDriver] No app sent in, not parsing package/activity
[info] [ADB] Getting device platform version
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 5.0
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell wm size'[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell wm density'[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell getprop ro.product.model'[info] [HTTP] <-- POST /wd/hub/session - - ms - -
[info] [HTTP] 
[debug] [ADB] Current device property 'ro.product.manufacturer': alps
[debug] [ADB] Device API level: 21
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell am force-stop io.appium.uiautomator2.server'[debug] [ADB] Checking app cert for /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk
[debug] [ADB] Starting '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner' with args '["verify","--print-certs","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk"]'[debug] [ADB] apksigner stdout: Signer #1 certificate DN: C=US, O=Android, CN=Android Debug
[debug] [ADB] Signer #1 certificate SHA-256 digest: 707bc2493ea5b0267dc10a9bd4cedbab5431976f13274cdd045d93470179556d
[debug] [ADB] Signer #1 certificate SHA-1 digest: b8db0b11cec13cc7574a7d62f383ec16c0d275ee
[debug] [ADB] Signer #1 certificate MD5 digest: 4fcd3b10d1e80a20bbd28758c8a3e19b
[debug] [ADB] WARNING: META-INF/INDEX.LIST not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
[debug] [ADB] WARNING: META-INF/io.netty.versions.properties not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
[debug] [ADB] 
[debug] [ADB] '/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' is not signed with debug cert.
[debug] [ADB] /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' is already zip-aligned. Doing nothing
[debug] [ADB] Signing '/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' with default cert
[debug] [ADB] Starting '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner' with args '["sign","--key","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8","--cert","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem","/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk"]'[warn] [ADB] Got an error during apksigner execution: Command '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner sign --key /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8 --cert /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' exited with code 1
[warn] [ADB] apksigner stderr: Exception in thread "main" java.nio.file.FileSystemException: /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk: Read-only file system
[warn] [ADB] 	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[warn] [ADB] 	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)
[warn] [ADB] 	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
[warn] [ADB] 	at java.nio.file.Files.move(Files.java:1395)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:342)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
[warn] [ADB] 
[warn] [ADB] Cannot use apksigner tool for signing. Defaulting to sign.jar. Original error: Command '/home/hezj/Software/AndroidStudio/SDK/build-tools/28.0.2/apksigner sign --key /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.pk8 --cert /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/keys/testkey.x509.pem /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk' exited with code 1; StdErr: Exception in thread "main" java.nio.file.FileSystemException: /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk: Read-only file system
[warn] [ADB] 	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[warn] [ADB] 	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[warn] [ADB] 	at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:447)
[warn] [ADB] 	at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:262)
[warn] [ADB] 	at java.nio.file.Files.move(Files.java:1395)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:342)
[warn] [ADB] 	at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
[warn] [ADB] 
[debug] [ADB] Resigning apk.
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [JSONWP Proxy] Matched '/' to command name 'deleteSession'
[warn] [UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 shell am force-stop com.android.settings'[debug] [ADB] Removing forwarded port socket connection: 8200 
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 forward --remove tcp\:8200'
[debug] [ADB] Running '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 forward --remove tcp\:8200'
[warn] [UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command '/home/hezj/Software/AndroidStudio/SDK/platform-tools/adb -P 5037 -s SA17607795 forward --remove tcp\:8200' exited with code 1'; Stderr: 'error: listener 'tcp:8200' not found'; Code: '1''
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1541640330498 (09:25:30 GMT+0800 (CST))
[debug] [MJSONWP] Encountered internal error running command: Error: Could not sign with default certificate. Original error Command '/usr/lib/jvm/java-8-oracle/bin/java -jar /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk --override' exited with code 1
[debug] [MJSONWP]     at ADB.callee$0$0$ (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/apk-signing.js:109:13)
[debug] [MJSONWP]     at tryCatch (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [MJSONWP]     at GeneratorFunctionPrototype.invoke [as _invoke] (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [MJSONWP]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [MJSONWP]     at GeneratorFunctionPrototype.invoke (/tmp/.mount_appiumhI2hjP/app/resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [MJSONWP]     at run (/tmp/.mount_appiumhI2hjP/app/resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:75:1)
[debug] [MJSONWP]     at /tmp/.mount_appiumhI2hjP/app/resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:92:1
[debug] [MJSONWP]     at flush (/tmp/.mount_appiumhI2hjP/app/resources/app/webpack:/~/babel-polyfill/~/core-js/modules/_microtask.js:18:1)
[debug] [MJSONWP]     at process._tickCallback (internal/process/next_tick.js:61:11)

This client log:

('WebDriverException Error: ', WebDriverException("An unknown server-side error occurred while processing the command. Original error: Could not sign with default certificate. Original error Command '/usr/lib/jvm/java-8-oracle/bin/java -jar /tmp/.mount_appiumB11sdT/app/resources/app/node_modules/appium/node_modules/appium-adb/jars/sign.jar /tmp/.mount_appiumB11sdT/app/resources/app/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.18.0.apk --override' exited with code 1", None, None))

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:14

github_iconTop GitHub Comments

12reactions
theduykhcommented, May 6, 2019

@jaelsonwagner I am facing the same issue. Could you and anyone else please guide me on how I can fix it on windows?

On Windows, try running Appium as administrator.

3reactions
jaelsonwagnercommented, Nov 8, 2018

Hi @mykola-mokhnach. A link in https://github.com/appium/appium-desktop/issues/705 send me here and here, https://github.com/appium/appium/issues/11655, there is a link to send me to https://github.com/appium/appium-desktop/issues/705 again. I’m in loop! There is a solution for reported problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Appium desktop server error when starting session could not ...
This problem can be resolved, by properly setting desiredCapabilities. Generally we specify automationName as uiautomator2. The moment we right ...
Read more >
Could not sign with default certificate. An unknown server-side ...
appium\node_modules\appium-uiautomator2-server\apks' for the Appium process, so it could sign the application. Environment. I am running Appium ...
Read more >
An unknown server-side error occurred while processing the ...
Original error: Could not sign with default certificate. Original error Command '/usr/lib/jvm/jdk1.8.0_221/bin/java -jar /tmp/.
Read more >
An unknown server-side error occurred while processing the ...
Original error: Could not sign with default certificate. Original error Command ''C:\Program Files\Java\jdk1.8.0_131\bin\java.exe' -jar ...
Read more >
Server-side error occurred while processing Appium-server
And why does this error come so late; why not at beginning ... is signed with the default certificate [UiAutomator2] Server packages are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found