-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't take a screenshot on Jenkins #265
Comments
Falling back to version |
One thing I had to do was add support to the |
Are you using adb over wifi? In that case I don't think taking screenshots over usb will work. Try to upgrade your calabash-android and run with screenshots from the test server instead
|
It works by modifying the Actually, I made the change in a different repository (roman10/roman10-android-tutorial), but both projects take the example code from the core Android codebase. The change is roughly: diff --git screenshot/src/com/android/ddmlib/AndroidDebugBridge.java screenshot/src/com/android/ddmlib/AndroidDebugBridge.java
index 950e313..0c2d83a 100755
--- screenshot/src/com/android/ddmlib/AndroidDebugBridge.java
+++ screenshot/src/com/android/ddmlib/AndroidDebugBridge.java
@@ -62,8 +62,18 @@ public final class AndroidDebugBridge {
static {
// built-in local address/port for ADB.
try {
+ int port = ADB_PORT;
+
+ // Allow the server port to be overridden
+ String envVar = System.getenv("ANDROID_ADB_SERVER_PORT");
+
+ if (envVar != null) {
+ port = Integer.parseInt(envVar);
+ System.out.println("Overriding server port: " + port);
+ }
+
sHostAddr = InetAddress.getByName(ADB_HOST);
- sSocketAddr = new InetSocketAddress(sHostAddr, ADB_PORT);
+ sSocketAddr = new InetSocketAddress(sHostAddr, port);
} catch (UnknownHostException e) {
} |
@jhansche Awesome! Do you want me to just add it to screenshotTaker or do you prefer to make the PR? |
Either way.. I just uploaded the PR: calabash/screenshotTaker#2 Tested and it works. |
@jhansche Why did you use the |
@brucardoso2 because that is what the adb tool looks for also :)
Also, The full list of environment variables exported by the Jenkins plugin is at: https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin#AndroidEmulatorPlugin-Environment |
I can run the tests ok in my local VM. However, trying to run this on Jenkins the it breaks whenever I try to take a screenshot (commenting the screenshot part works).
The text was updated successfully, but these errors were encountered: