I'm currently learning how to use Appium.
My workspace looks as following:
I'm using Windows 10 Pro
Android Studio 3.6.1 as my IDE
The AVD-Manager from Android Studio
Adb as a Bridge
Desktop-Appium 1.15
And Java jdk-14
After quite some time I got everything to work. I think my PATH variables are set correctly, I can call Java and adb in cmd.
So I wanted to start some test cases, where I want to automate the login of a mail app.
Here I run into the error.
#
# Log Appium Server
#
[UiAutomator2] Unable to remove port forward 'Error executing adbExec. Original error: 'Command 'C:\\Users\\Yggdrasil\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 forward --remove tcp\:8200' exited with code 1'; Stderr: 'adb.exe: error: listener 'tcp:8200' not found'; Code: '1''
[UiAutomator2] Restoring hidden api policy to the device default configuration
[ADB] Running 'C:\Users\Yggdrasil\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps'
[ADB] Running 'C:\Users\Yggdrasil\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_p_apps'
[ADB] Running 'C:\Users\Yggdrasil\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy'
[BaseDriver] Event 'newSessionStarted' logged at 1585093850179 (00:50:50 GMT+0100 (Mitteleuropäische Zeit))
[MJSONWP] Encountered internal error running command: Error: packageAndLaunchActivityFromManifest failed. Original error: Command 'java -jar C:\\Users\\Yggdrasil\\AppData\\Local\\Programs\\Appium\\resources\\app\\node_modules\\appium\\node_modules\\appium-adb\\jars\\appium_apk_tools.jar printLaunchActivity C:\\Users\\Yggdrasil\\Downloads\\gmx-6.5.7.apk C:\\Users\\YGGDRA~1\\AppData\\Local\\Temp\\de.gmx.mobile.android.mail' exited with code 1; StdErr: Exception in thread "main" java.lang.NoSuchFieldException: modifiers
[MJSONWP] at java.base/java.lang.Class.getDeclaredField(Class.java:2489)
[MJSONWP] at io.appium.apktools.StringsXML.silenceLogger(StringsXML.java:120)
[MJSONWP] at io.appium.apktools.Main.main(Main.java:25)
[MJSONWP]
[MJSONWP] at ADB.packageAndLaunchActivityFromManifest (C:\Users\Yggdrasil\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-adb\lib\tools\android-manifest.js:136:9)
[HTTP] <-- POST /wd/hub/session 500 1350 ms - 844
[HTTP]
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 3 ms - 57
[HTTP]
Here are the Appium Desired Capabilities:
{
"platformName": "Android",
"deviceName": "Android Emulator",
"appPackage": "de.gmx.mobile.android.mail",
"appWaitActivity": "com.unitedinternet.portal.ui.login.LoginActivity",
"app": "C:\\Users\\Yggdrasil\\Downloads\\gmx-6.5.7.apk"
}
I googled about Error: packageAndLaunchActivityFromManifest but didn't found a way to solve this for me. Hit me up if you need any more information! Thank you for your time. I greatly appreciate your help!
NOTE:
Instead of adb shell "dumpsys window windows | grep -E 'mCurrentFocus'" I have to use adb shell "dumpsys window windows | grep -E 'mObscuringWindow'" to get the appPackage for Appium Desired Capabilities
Is this from the new Version of adb or AVD?
I found the mistake.
Apparently Appium and Android Studio 3.6 don't go together very well.
Appium is using the SDK tools, you had to edit to the PATH viable. But Android Studio 3.6 is using a new version of SDK tools, so Appium wasn't able to find them properly.
I found this mistake with AppiumDoctor.
After Downgrading Android Studio to version 3.3 all works properly.
Related
I am trying to start an appium inspector session, however I keep having problems with apkanalyzer.bat, now I received the following message:
Using 'apkanalyzer.bat' from 'C:\Users\ayla_\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat'
[ADB] Starting 'C:\Users\ayla_\AppData\Local\Android\Sdk\tools\bin\apkanalyzer.bat' with args ["-h","manifest","print","C:\\Users\\ayla_\\Documents\\Documentos_Ayla\\Treinamentos\\Automacao Mobile\\File Manager by Astro File Browser_v7.4.0_apkpure.com.apk"]
[ADB] Using the alternative activity name detection method because of: Command 'C\:\\Users\\ayla_\\AppData\\Local\\Android\\Sdk\\tools\\bin\\apkanalyzer.bat -h manifest print 'C:\\Users\\ayla_\\Documents\\Documentos_Ayla\\Treinamentos\\Automacao Mobile\\File Manager by Astro File Browser_v7.4.0_apkpure.com.apk'' exited with code 255
[ADB] Extracting package and launch activity from manifest
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Called deleteSession but bootstrap wasn't active
[Logcat] Stopping logcat capture
[ADB] Running 'C:\Users\ayla_\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock'
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[BaseDriver] Event 'newSessionStarted' logged at 1569549028506 (22:50:28 GMT-0300 (Hora oficial do Brasil))
[MJSONWP] Encountered internal error running command: Error: packageAndLaunchActivityFromManifest failed. Original error: Command 'java -jar C\:\\Users\\ayla_\\AppData\\Local\\Programs\\appium-desktop\\resources\\app\\node_modules\\appium\\node_modules\\appium-adb\\jars\\appium_apk_tools.jar printLaunchActivity 'C:\\Users\\ayla_\\Documents\\Documentos_Ayla\\Treinamentos\\Automacao Mobile\\File Manager by Astro File Browser_v7.4.0_apkpure.com.apk' C\:\\Users\\ayla_\\AppData\\Local\\Temp\\com.metago.astro' exited with code 1; StdErr: Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f060046 color/common_google_signin_btn_text_dark_default, config=[DEFAULT]
If someone knows the solution to this problem, please share with me.
Can anyone help me out I am new to Android testing with Appium , I am trying to open app in AVD the app getting installed but then m getting Error "A new Session could not be created.(Original error: Command failed: )","killed":false,"code":1,"signal":null,"origValue":"Command failed: "},"sessionId":null}
Thanks for the help in advance
tried with just giving capabilities.setCapability("appActivity", ".MainActivity");
'''
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "/Apps/src/");
File app = new File(appDir, "ChatApp-release.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "emulator-5554");
capabilities.setCapability("platformVersion", "7.1.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "com.aaa.charla");
capabilities.setCapability("appActivity", "com.aaa.xxx.MainActivity");
driver = new AndroidDriver(new URL("https://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
Thread.sleep(10000);
driver.quit();
Following are the Debug log:
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk","appPackage":"com.odysseyinc.charla","appActivity":"com.odyssey.chatapp.MainActivity","newCommandTimeout":"10000","platformName":"Android","version":"7.1.1","deviceName":"emulator-5554"}}
info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_162)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version
info: [debug] Using local app from desired caps: D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk
info: [debug] Creating new appium session 0d25aeac-d055-449f-af84-b6d314d9b4a5
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_162
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe
info: [debug] Set chromedriver binary as: C:\Program Files (x86)\Appium\node_modules\appium\build\chromedriver\windows\chromedriver.exe
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device emulator-5554
info: [debug] Setting device id to emulator-5554
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 wait-for-device
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 25
info: Device API level is: 25
info: [debug] Extracting strings for language: default
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop persist.sys.language"
info: [debug] Current device persist.sys.language:
info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk" "C:\Users\UNMESH~1.GHA\AppData\Local\Temp\com.odysseyinc.charla"
info: [debug] Reading strings from converted strings.json
info: [debug] Setting language to default
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 push "C:\Users\UNMESH~1.GHA\AppData\Local\Temp\com.odysseyinc.charla\strings.json" /data/local/tmp
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\build-tools\28.0.3\aapt.exe
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\build-tools\28.0.3\aapt.exe dump xmltree D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk AndroidManifest.xml
info: [debug] Set app process to: com.odysseyinc.charla
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk.
info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk
info: [debug] App already signed.
info: [debug] Zip-aligning D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\build-tools\28.0.3\zipalign.exe
info: [debug] Zip-aligning apk.
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\build-tools\28.0.3\zipalign.exe -f 4 D:\AndroidNew\Yrreport\YrReport\RemoteSystemsTempFiles\Appium\apk\ChatApp-master-0.9.35.1195-release.apk C:\Users\UNMESH~1.GHA\AppData\Local\Temp\119427-15556-1rmbgw9\appium.tmp
info: [debug] MD5 for app is f3d7efc8b197792c3d0529a48dc92ff2
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "ls /data/local/tmp/f3d7efc8b197792c3d0529a48dc92ff2.apk"
info: [debug] Getting install status for com.odysseyinc.charla
info: [debug] Getting device API level
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 25
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "pm list packages -3 com.odysseyinc.charla"
info: [debug] App is installed
info: App is already installed, resetting app
info: [debug] Running fast reset (stop and clear)
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "am force-stop com.odysseyinc.charla"
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell "pm clear com.odysseyinc.charla"
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: C:\Users\unmesh.ghatbandhe\AppData\Local\Android\Sdk\platform-tools\adb.exe -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
error: Failed to start an Appium session, err was: Error: Command failed: adb: failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: Command failed: adb: failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]
at ChildProcess.exithandler (child_process.js:637:15)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: adb: failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n)","killed":false,"code":1,"signal":null,"origValue":"Command failed: adb: failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 32039.992 ms - 664
`
You need to share the full appium logs in order to know the reason for that.
[After checking the logs]
That's a known issue for that specific Android image as it installs 2 versions of appium settings app and unlock app. What you can do is either change the android image you are testing against or uninstall those 2 apps before starting your script.
You can uninstall them manually by starting the emulator GUI and do that with the mouse or through the below commands:
adb -s device_serial uninstall io.appium.settings
adb -s device_serial uninstall io.appium.unlock
Also, you can add those commands in your code if you really have to execute the tests on android 7 devices as below:
String androidVersion=executeCommand("adb shell getprop ro.build.version.release");
if(androidVersion.contains("7"))
{
//uninstall appium settings app
cmd="adb uninstall io.appium.settings";
executeCommand(cmd);
//uninstall appium unlock app
cmd="adb uninstall io.appium.unlock";
executeCommand(cmd);
}
I have upgraded the Appuim 1.4 to 1.9 and started working as Expected .
I run the android automation test from eclipse it throws
Encountered internal error running command: Error: Command 'java -version' exited with code 20
Appium Logfile:
`[BaseDriver] Event 'newSessionRequested' logged at 1519716463353
(12:57:43 GMT+0530 (IST)) [Appium] Merged W3C capabilities
{"desiredCapabilities":{"app":"/Users/sathish/S... into
desiredCapabilities object
{"app":"/Users/sathish/Sathish/CASA/Automation ... [Appium] Creating
new AndroidDriver (v1.39.0) session [Appium] Capabilities: [Appium]
app: /Users/sathish/Sathish/CASA/Automation
Test/EndlessAisleAutomationTest/app/app-qa-debug.apk [Appium]
appActivity: tech.ajira.endlessAisle.activities.TenantLoginActivity
[Appium] appPackage: tech.ajira.endlessAisle [Appium]
deviceName: Google Nexus 9 [Appium] platformName: android
[BaseDriver] [BaseDriver] W3C capabilities [] and MJSONWP desired
capabilities were provided [BaseDriver] Expected W3C "capabilities"
to be a JSON Object but was provided with: [] [BaseDriver] Falling
back to MJSONWP desired capabilities [BaseDriver] Session created
with session id: e1e27d58-611a-4877-b8fc-8e7e98351be1
[AndroidDriver] Getting Java version [AndroidDriver] Shutting down
Android driver [AndroidDriver] Called deleteSession but bootstrap
wasn't active [MJSONWP] Encountered internal error running command:
Error: Command 'java -version' exited with code 20
at ChildProcess. (/Applications/Appium.app/Contents/Resources/app/node_modules/teen_process/lib/teen_process.js:97:19)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:194:7)
at maybeClose (internal/child_process.js:899:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at Pipe._handle.close [as _onclose] (net.js:510:12) [HTTP] <-- POST /wd/hub/session 500 41 ms - 180`
Please help me to fix this issue. Thank you
Seems Appium is not able to connect to the running emulator. Try setting correct values for deviceName and platformVersion capabilities to find the connected device.
In command prompt try running adb devices to get the device name.
Have a problem where all of a sudden a previously working appium based android app selenium test has stopped working as it did (consistently successful).
The issue is specifically to do with the launch of the app by appium (the app always launches when opened with physical user input..). Basically the app launches, the loading screen appears and then it crashes. This happens most of the time but not always. I've found it usually works fine initially after restarting the phone. However, it'll crash on subsequent runs.
Any assistance would be much appreciated. Tried many things/searching online already but it's all been to of no avail..
Here's the appium output:
[AndroidDriver] Parsed pid: '27608' pkg: 'com.dedsert.betbright.uat' from
[AndroidDriver] USER PID PPID VSIZE RSS WCHAN PC NAME
[AndroidDriver] u0_a236 27608 4736 3621124 393160 0 0000000000 R com.dedsert.betbright.uat
[AndroidDriver] Returning process name: 'com.dedsert.betbright.uat'
[AndroidDriver] Found webviews: ["WEBVIEW_com.dedsert.betbright.uat"]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.dedsert.betbright.uat"]
[MJSONWP] Responding to client with driver.setContext() result: null
[HTTP] <-- POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context 200 245 ms - 76
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.StackOverflowError
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_RESULT: longMsg=stack size 1037KB
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_CODE: 0
[UiAutomator] UiAutomator exited unexpectedly with code 4294967295, signal null
[UiAutomator] Moving to state 'stopped'
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was 'UiAUtomator shut down unexpectedly'
[Appium] Removing session a9457315-d657-4fd1-bdf0-36fe5d76b3c5 from our master session list
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","am","force-stop","com.dedsert.betbright.uat"]
[ADB] Pressing the HOME button
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","input","keyevent",3]
[AndroidBootstrap] Cannot shut down Android bootstrap; it has already shut down
[Logcat] Stopping logcat capture
[ADB] Getting connected devices...
[ADB] 1 device(s) connected
[ADB] Running 'C:\Users\kroring\AppData\Local\Android\Sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","ce051715c336451002","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[HTTP] --> POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context {"name":"WEBVIEW_com.dedsert.betbright.uat"}
[HTTP] <-- POST /wd/hub/session/a9457315-d657-4fd1-bdf0-36fe5d76b3c5/context 404 1 ms - 131
Not a whole lot to be seen on the IntelliJ side - did spot this in the stacktrace given:
org.openqa.selenium.remote.SessionNotFoundException: A session is either terminated or not started (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 5 milliseconds
Uninstall appium and reinstall appium and it will work for you.
From command line.
npm uninstall -g appium
Reinstall the appium.
npm install -g appium
Looks like your phone is out of memory. It could be worthwhile to clear the cache of your testing phone :
Power off your device. This method is different for different
manufacturers, and you should look it up on the internet before
proceeding further.
Load into your bootloader screen by holding down
a combination of keys. In some devices, you have to press the Power
button with Volume down key simultaneously. In other devices, Power
button with both the Volume keys have to pressed simultaneously.
Touchscreen might not work, and you have to navigate using Volume
keys.
Go to Recovery and select it with a tap on the Power button.
Go to Wipe cache partition and tap the Power button to select it.
After the cache gets cleared, select Reboot system now.
Information from (step 4): https://fossbytes.com/clear-android-cache-data-quick-methods/
I trying to run an UPnP service on my docker container using the Cling UPNP library (http://4thline.org/projects/cling/). There is a simple program that creates a device (in software) that hosts some service. This is written in Java and when I try to run the program I get the following exception (Note: This runs perfectly fine directly on my Ubuntu machine):
Jun 5, 2015 1:47:24 AM org.teleal.cling.UpnpServiceImpl <init>
INFO: >>> Starting UPnP service...
Jun 5, 2015 1:47:24 AM org.teleal.cling.UpnpServiceImpl <init>
INFO: Using configuration: org.teleal.cling.DefaultUpnpServiceConfiguration
Jun 5, 2015 1:47:24 AM org.teleal.cling.transport.RouterImpl <init>
INFO: Creating Router: org.teleal.cling.transport.RouterImpl
Exception occured: org.teleal.cling.transport.spi.InitializationException: Could not discover any bindable network interfaces and/or addresses
org.teleal.cling.transport.spi.InitializationException: **Could not discover any bindable network interfaces and/or addresses
at org.teleal.cling.transport.impl.NetworkAddressFactoryImpl.<init>(NetworkAddressFactoryImpl.java:99)**
For anyone that finds this and needs the answer.
Your container is obscuring your external network. In other words, by default containers are isolated and cannot see the outer network which is of course required in order to open the ports in your IGD.
You can run your container as a "host" to make it non isolated, simply add --network host to your container creation command.
Example (taken from https://docs.docker.com/network/network-tutorial-host/#procedure):
docker run --rm -d --network host --name my_nginx nginx
I have tested this using docker-compose.yml which looks a bit different:
version: "3.4"
services:
upnp:
container_name: upnp
restart: on-failure:10
network_mode: host # works while the container runs
build:
context: .
network: host # works during the build if needed
version 3.4 is very important and the network: host will not work otherwise!
My upnp container Dockerfile looks like so:
FROM alpine:latest
RUN apk update
RUN apk add bash
RUN apk add miniupnpc
RUN mkdir /scripts
WORKDIR /scripts
COPY update_upnp .
RUN chmod a+x ./update_upnp
# cron to update each UPnP entries every 10 minutes
RUN echo -e "*/10\t*\t*\t*\t*\tbash /scripts/update_upnp 8080 TCP" >> /etc/crontabs/root
CMD ["crond", "-f"]
# on start, open needed ports
ENTRYPOINT bash update_upnp 80 TCP && bash update_upnp 8080 TCP
update_upnp script is simply using upnpc (installed as miniupnpc in the Dockerfile above) to open the ports.
Hopefully this will help somebody.
Edit: Here is how update_upnp script may look like:
#!/bin/bash
port=$1
protocol=$2
echo "Updating UPnP entry with port [$port] and protocol [$protocol]"
gateway=$(ip route | head -1 | awk '{print $3}')
echo "Detected gateway is [$gateway]"
# port - e.g. 80
# protocol - TCP or UDP
upnpc -e 'your-app-name' -r $port $protocol
echo "Done updating UPnP entry with port [$port] and protocol [$protocol]"