beanshell:
import java.text.*;
import java.util.Date;
import java.util.Calendar;
//年:需设定的年份-1900,月:从 0 开始
Date currentTime = new Date(2017-1900,12-1,31);
Calendar c = Calendar.getInstance();
c.setTime(currentTime);
c.add(Calendar.DATE, 1);// +1 天
Date tomorrow = c.getTime();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(tomorrow);
vars.put("Date",dateString);
@lihuazhang
我在https://bitbucket.org/appium/appium.app/downloads/看到最新的是
“0.12.3”,给个 0.13 的下载链接吧!谢谢
我最开始用的就是官方版本。下面是用官版本出现的错误信息。
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 push "E:\Eclipseworkspace\AndroidContactsTest\apps\ContactM
anager\ContactManager.apk" /data/local/tmp/4621b5c217c790d3e00fe3a441331c76.apk
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 shell "pm install -r /data/local/tmp/4621b5c217c790d3e00fe3a441
331c76.apk"
info: [ADB] Forwarding system:4724 to device:4724
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 forward tcp:4724 tcp:4724
debug: Pushing appium bootstrap to device...
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 push "F:\selenium\Appium\Appium\node_modules\appium\build
\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/
debug: Pushing unlock helper app to device...
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 install F:\selenium\Appium\Appium\node_modules\appium\build\unl
ock_apk\unlock_apk-debug.apk
info: Attempting to kill all 'uiautomator' processes
info: Getting all processes with 'uiautomator'
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 shell "ps | grep 'uiautomator'"
info: Stopping logcat capture
info: Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: Cleaning up android objects
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not extract PIDs
from ps output. PIDS: [], Procs: ["grep: not found"]
info: Responding to client with error: {"status":33,"value":{"message":"A new se
ssion could not be created. (Original error: Could not extract PIDs from ps outp
ut. PIDS: [], Procs: [\"grep: not found\"])","origValue":"Could not extract PIDs
from ps output. PIDS: [], Procs: [\"grep: not found\"]"},"sessionId":null}
POST /wd/hub/session 500 31629ms - 304b
这是错误信息:
info: Attempting to kill all 'uiautomator' processes
info: Getting all processes with 'uiautomator'
debug: executing: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe"
-s emulator-5554 shell "ps 'uiautomator'"
info: Stopping logcat capture
info: Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
info: Cleaning up android objects
info: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not extract PIDs
from ps output. PIDS: [], Procs: ["USER PID PPID VSIZE RSS WCHAN
PC NAME"]
info: Responding to client with error: {"status":33,"value":{"message":"A new se
ssion could not be created. (Original error: Could not extract PIDs from ps outp
ut. PIDS: [], Procs: [\"USER PID PPID VSIZE RSS WCHAN PC
NAME\"])","origValue":"Could not extract PIDs from ps output. PIDS: [], Procs: [
\"USER PID PPID VSIZE RSS WCHAN PC NAME\"]"},"sessionId":
null}
POST /wd/hub/session 500 25906ms - 394b
我的 appium 是 2013-12-12 的最新版本,还是有这个问题。
按照 6 楼进行修改后,还是报错。API 是 4.03 的虚拟设备。
怎么办?