Giter VIP home page Giter VIP logo

devicemanager's Introduction

DeviceManager

Utility to Manage Connected iOS & Android Devices (Including iOS Simulators and Android Emulators)

Maven:

Add following dependency to your pom.xml

<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
</repositories>
<dependency>
	    <groupId>com.github.SrinivasanTarget</groupId>
	    <artifactId>iOSDeviceManager</artifactId>
	    <version>master-SNAPSHOT</version>
</dependency>

Exposed Methods:

  • getAllSimulators - Gets all available or installed simulators in macOS
  • getSimulatorUDID - Returns UDID of simulator needed.
  • getSimulatorState - Returns state of Simulator e.g booted, shutdown, etc
  • bootSimulator - Will boot the specified Simulator
  • install - Will install the application on Simulator
  • uninstall - Will remove the application from Simulator
  • getSimulatorDetailsFromUDID - Retrives simulator details for given UDID
  • captureScreenshot - Captures screenshot for given UDID.
  • shutDownAllBootedSimulators - Shutdown all booted simulators
  • getAllBootedSimulators - Retrives all booted simulators

devicemanager's People

Contributors

deepakarorawins avatar saikrishna321 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

devicemanager's Issues

Getting exception while running the code on Windows PC

When I was running the code on Windows machine with one Android device connected. Following exception occurred. I tried to debug the issue and found that In CommandPromptUtil.class , getBufferedReader method "Cannot run the program /bin/sh : Create error process=2" exception is getitng

Below is exception :

java.io.IOException: Cannot run program "/bin/sh": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at com.thoughtworks.utils.CommandPromptUtil.getBufferedReader(CommandPromptUtil.java:41)
at com.thoughtworks.utils.CommandPromptUtil.runCommandThruProcess(CommandPromptUtil.java:15)
at com.thoughtworks.android.AndroidManager.startADB(AndroidManager.java:27)
at com.thoughtworks.android.AndroidManager.getDeviceProperties(AndroidManager.java:79)
at com.thoughtworks.device.DeviceManager.getDeviceProperties(DeviceManager.java:32)
at com.appium.manager.DeviceAllocationManager.(DeviceAllocationManager.java:59)
at com.appium.manager.DeviceAllocationManager.getInstance(DeviceAllocationManager.java:73)
at com.appium.manager.ParallelThread.(ParallelThread.java:49)
at com.test.cucumber.cukesrunner.RunnerCukes.testCukesRunner(RunnerCukes.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 39 more

java.lang.NullPointerException
at com.appium.manager.DeviceAllocationManager.getCapsFilePath(DeviceAllocationManager.java:150)
at com.appium.manager.DeviceAllocationManager.setFlagsForCapsValues(DeviceAllocationManager.java:129)
at com.appium.manager.DeviceAllocationManager.(DeviceAllocationManager.java:67)
at com.appium.manager.DeviceAllocationManager.getInstance(DeviceAllocationManager.java:73)
at com.appium.manager.ParallelThread.(ParallelThread.java:49)
at com.test.cucumber.cukesrunner.RunnerCukes.testCukesRunner(RunnerCukes.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runners.Suite.runChild(Suite.java:127)
at org.junit.runners.Suite.runChild(Suite.java:26)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Disconnected from the target VM, address: '127.0.0.1:62538', transport: 'socket'

Process finished with exit code -1

Starting Device Manager

How do we build and start the Device Manager? Also, is the IP and Port number on AndroidTest.java corresponding to an Android Device?

Unable to find the UDID of connected device using Java

Unable to find the UDID of connected device using java, please find the code , I am able to pull the UDID using the command '"system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad|iPod)/" + ",/Serial/s/ *Serial Number: *(.+)/\1/p'"', but not able to pull the UDID using "idevice_id -l"

but while appium is running it internally uses idevice_id -l to list the device UDID

Boot and Install on Real Devices

Hi, is there a way to boot a connected real device as well as install applications on real device? I want to be able to boot all/selective real devices and install applications on real devices. Is this possible?

New iOS Devices with 25 digit Udid is not supported

The new iOS Udid has 24 characters in udid, which is different from the 40 digits udid in previous iOS Phones.

Verified in the ATD code, where we have only public final static int IOS_UDID_LENGTH = 40; as the ios udid variable mentioned for adding the iOS device, which doesn't run automation in the current iOS device.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.