按照网上 appium 的例子 AndroidContactsTest
最后运行时报错 error: Failed to start an Appium session, err was: Error: Parameter 'appPackage' is required for launching application

info: Welcome to Appium v1.0.0 (REV f0a00fab2335fa88cb355ab4dc43a9cd3f3236c0)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"WINDOWS
","app":"D:\xxl\java\workspace\my-app-web-two\apps\ContactManager\Contact
Manager.apk","browserName":"","app-package":"com.example.android.contactmanager"
,"device":"Android","app-activity":".ContactManager","version":"4.4"}}
info: No appActivity desired capability or server param. Parsing from apk.
info: No appPackage desired capability or server param. Parsing from apk.
info: Using local app from desired caps: D:\xxl\java\workspace\my-app-web-two\ap
ps\ContactManager\ContactManager.apk
info: Creating new appium session 6aac7045-22d0-4fe9-b805-1402a5ab5b33
info: Starting android appium
debug: Using fast reset? true
info: Preparing device for session
info: Checking whether app is actually present
info: Checking whether adb is present
info: [ADB] Using adb from D:\xxl\java\adt-bundle-windows-x86_64-20140321\sdk\pl
atform-tools\adb.exe
info: Trying to find a connected android device
info: [ADB] Getting connected devices...
debug: executing: "D:\xxl\java\adt-bundle-windows-x86_64-20140321\sdk\platform-t
ools\adb.exe" devices
info: [ADB] 1 device(s) connected
info: Setting device id to emulator-5554
info: [ADB] Waiting for device to be ready and to respond to shell commands (tim
eout = 5)
debug: executing: "D:\xxl\java\adt-bundle-windows-x86_64-20140321\sdk\platform-t
ools\adb.exe" -s emulator-5554 wait-for-device
debug: executing: "D:\xxl\java\adt-bundle-windows-x86_64-20140321\sdk\platform-t
ools\adb.exe" -s emulator-5554 shell "echo 'ready'"
info: Starting logcat capture
info: Checking whether aapt is present
info: Getting device API level
debug: executing: "D:\xxl\java\adt-bundle-windows-x86_64-20140321\sdk\platform-t
ools\adb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk"
info: Device is at API Level 19
info: Stopping logcat capture
debug: Logcat terminated with code null, signal SIGTERM
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: Parameter 'appPackage'
is required for launching application
info: Error: Parameter 'appPackage' is required for launching application
at Android.pushStrings (D:\xxl\java\nodejs\node_modules\appium\lib\devices\a
ndroid\android.js:301:17)
at D:\xxl\java\nodejs\node_modules\appium\node_modules\async\lib\async.js:59
5:21
at D:\xxl\java\nodejs\node_modules\appium\node_modules\async\lib\async.js:23
5:13
at iterate (D:\xxl\java\nodejs\node_modules\appium\node_modules\async\lib\as
ync.js:142:13)
at D:\xxl\java\nodejs\node_modules\appium\node_modules\async\lib\async.js:15
3:25
at D:\xxl\java\nodejs\node_modules\appium\node_modules\async\lib\async.js:23
7:17
at D:\xxl\java\nodejs\node_modules\appium\node_modules\async\lib\async.js:60
0:34
at D:\xxl\java\nodejs\node_modules\appium\lib\devices\android\android.js:266
:5
at D:\xxl\java\nodejs\node_modules\appium\lib\devices\android\adb.js:630:7
at D:\xxl\java\nodejs\node_modules\appium\lib\devices\android\adb.js:154:5
info: Responding to client with error: {"status":33,"value":{"message":"A new se
ssion could not be created. (Original error: Parameter 'appPackage' is required
for launching application)","origValue":"Parameter 'appPackage' is required for
launching application"},"sessionId":null}

POST /wd/hub/session 500 7751ms - 270b

新人求解


↙↙↙阅读原文可查看相关链接,并与作者交流