我在MacOS上使用Android安装Appium 1.6.4时遇到了问题。
用于实例化Appium Android驱动程序的C#代码
public IWebDriver MakeAndroidDriver()
{
//Initialization of Android driver
DesiredCapabilities androidCapabilities = new DesiredCapabilities();
androidCapabilities.SetCapability(“deviceName”, “Nexus6”);
androidCapabilities.SetCapability(“platformName”, “Android”);
androidCapabilities.SetCapability(“noReset”, true);
androidCapabilities.SetCapability(“newCommandTimeout”, 120);
androidCapabilities.SetCapability(“app”, “\Users\mats\Documents\Test\builds\Android\com.abc.xyz-Signed.apk”);
androidCapabilities.SetCapability(“autoLaunch”, true);
androidCapabilities.SetCapability(“appWaitActivity”, “md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity”);
androidDriver = new RemoteWebDriver(new Uri(“http://127.0.0.1:4723/wd/hub”), androidCapabilities);
androidDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20));
return androidDriver;
}
public IWebDriver MakeAndroidDriver()
{
//Initialization of Android driver
DesiredCapabilities androidCapabilities = new DesiredCapabilities();
androidCapabilities.SetCapability(“deviceName”, “Nexus6”);
androidCapabilities.SetCapability(“platformName”, “Android”);
androidCapabilities.SetCapability(“noReset”, true);
androidCapabilities.SetCapability(“newCommandTimeout”, 120);
androidCapabilities.SetCapability(“app”, “\Users\mats\Documents\Test\builds\Android\com.abc.xyz-Signed.apk”);
androidCapabilities.SetCapability(“autoLaunch”, true);
androidCapabilities.SetCapability(“appWaitActivity”, “md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity”);
androidDriver = new RemoteWebDriver(new Uri(“http://127.0.0.1:4723/wd/hub”), androidCapabilities);
androidDriver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(20));
return androidDriver;
}
Appium日志
[Appium] Welcome to Appium v1.6.5
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“deviceName”:“Nexus6”,“platformName”:“Android”,“newCommandTimeout”:120,“app”:"\Users\mats\Documents\test\builds\Android\com.abc.xyz-Signed.apk",“autoLaunch”:true,“appWaitActivity”:“md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“deviceName”:“Nexus6”,“platformName”:“Android”,“newCommandTimeout”:120,“app”:"\Users\mats\Documents\test\builds\Android\com.abc.xyz-Signed.apk",“autoLaunch”:true,“appWaitActivity”:“md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity”},null,null]
[BaseDriver] Event ‘newSessionRequested’ logged at 1501307358060 (11:19:18 GMT+0530 (IST))
[Appium] Creating new AndroidDriver (v1.20.0) session
[Appium] Capabilities:
[Appium] deviceName: ‘Nexus6’
[Appium] platformName: ‘Android’
[Appium] newCommandTimeout: 120
[Appium] app: ‘\Users\mats\Documents\test\builds\Android\com.abc.xyz-Signed.apk’
[Appium] autoLaunch: true
[Appium] appWaitActivity: ‘md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity’
[AndroidDriver] AndroidDriver version: 1.20.0
[BaseDriver] Session created with session id: 49849eae-62ad-405d-9ed0-e126b7aefa4a
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_101
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/mats/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/mats/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb
[ADB] Setting device id to emulator-5554
[BaseDriver] Error Unmounting :Command ‘umount /Volumes/Documents’ exited with code 1
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Called deleteSession but bootstrap wasn’t active
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘/Users/mats/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb’ with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
[AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.
[MJSONWP] Encountered internal error running command: Error: EACCES: permission denied, rmdir 'Volumes’
at Error (native)
[HTTP] <-- POST /wd/hub/session 500 1780 ms - 179
详细的npm日志
[Appium] Welcome to Appium v1.6.5
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“deviceName”:“Nexus6”,“platformName”:“Android”,“newCommandTimeout”:120,“app”:"\Users\mats\Documents\test\builds\Android\com.abc.xyz-Signed.apk",“autoLaunch”:true,“appWaitActivity”:“md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity”}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“deviceName”:“Nexus6”,“platformName”:“Android”,“newCommandTimeout”:120,“app”:"\Users\mats\Documents\test\builds\Android\com.abc.xyz-Signed.apk",“autoLaunch”:true,“appWaitActivity”:“md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity”},null,null]
[BaseDriver] Event ‘newSessionRequested’ logged at 1501307358060 (11:19:18 GMT+0530 (IST))
[Appium] Creating new AndroidDriver (v1.20.0) session
[Appium] Capabilities:
[Appium] deviceName: ‘Nexus6’
[Appium] platformName: ‘Android’
[Appium] newCommandTimeout: 120
[Appium] app: ‘\Users\mats\Documents\test\builds\Android\com.abc.xyz-Signed.apk’
[Appium] autoLaunch: true
[Appium] appWaitActivity: ‘md5b08c782cf9319c3de44b6835de7e19a8.BrandActivity’
[AndroidDriver] AndroidDriver version: 1.20.0
[BaseDriver] Session created with session id: 49849eae-62ad-405d-9ed0-e126b7aefa4a
[AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_101
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/mats/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[AndroidDriver] Using device: emulator-5554
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/mats/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb
[ADB] Setting device id to emulator-5554
[BaseDriver] Error Unmounting :Command ‘umount /Volumes/Documents’ exited with code 1
[AndroidDriver] Shutting down Android driver
[AndroidDriver] Called deleteSession but bootstrap wasn’t active
[ADB] Getting connected devices…
[ADB] 1 device(s) connected
[ADB] Running ‘/Users/mats/Library/Developer/Xamarin/android-sdk-macosx/platform-tools/adb’ with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“am”,“force-stop”,“io.appium.unlock”]
[AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.
[MJSONWP] Encountered internal error running command: Error: EACCES: permission denied, rmdir 'Volumes’
at Error (native)
[HTTP] <-- POST /wd/hub/session 500 1780 ms - 179
请帮助