{"id":96713,"date":"2018-06-18T10:00:13","date_gmt":"2018-06-18T01:00:13","guid":{"rendered":"https:\/\/appkitbox.com\/en\/?page_id=96713"},"modified":"2026-02-04T10:27:35","modified_gmt":"2026-02-04T01:27:35","slug":"appium_tutorial","status":"publish","type":"page","link":"https:\/\/appkitbox.com\/en\/support\/automation\/appium_tutorial\/","title":{"rendered":"How to Use Appium Cloud"},"content":{"rendered":"<h2>Tutorial for Appium Features<\/h2>\n<h3 class=\"appium-ttl\">Overview<\/h3>\n<p>Appium is a test framework to automate testing on a smartphone or tablet.<\/p>\n<p>Previously, automated testing with Remote TestKit was possible using an Appium environment built on a local computer by using the virtual ADB and Xcode connector features. In June 2018 release, Appium test script can now run easily without building an Appium server environment and a link can also be easily made with CI environment.<\/p>\n<p>* Remote TestKit Appium Cloud is available only to customers who have a Flat 3 or higher plan.<\/p>\n<h3 class=\"appium-ttl\">Appium Links Supported by Remote TestKit<\/h3>\n<p><img loading=\"lazy\" width=\"1560\" height=\"940\" src=\"\/en\/wp-content\/uploads\/sites\/2\/img001-3.png\" alt=\"\" class=\"alignleft size-full wp-image-96715 appium-img appium-img2\"><\/p>\n<h4 class=\"appium-ttl\">An Appium Environment that Does Not Use Remote TestKit<\/h4>\n<p>Generally, a run environment, such as Node.js or an Appium server, must be built on a local computer that runs Appium, the test script created and then run in order to automate testing with Appium, as shown in the figure below.<\/p>\n<p>Moreover, only a test device connected to a local computer could be used as the device used for the test script and in many cases an Android\/iOS simulator had to be used.<\/p>\n<div class=\"appium-cr\">\n<img loading=\"lazy\" width=\"1560\" height=\"940\" src=\"\/en\/wp-content\/uploads\/sites\/2\/img002-3.png\" alt=\"\" class=\"alignleft size-full wp-image-96716 appium-img appium-img2\"><\/p>\n<h4 class=\"appium-ttl\">An Appium Environment that Uses the Conventional Remote TestKit Features<\/h4>\n<p>In the past, it was possible with Remote TestKit to build an Appium environment that used a device on the cloud by using the virtual ADB and Xcode connector features. In this configuration, the link between a cloud hosted device and local environment is established at lower layer, which has the merit of enabling links to test frameworks other than Appium.<br \/>\nNote: Some features are limited in debuggers that use Xcode in iOS devices.<\/p>\n<\/div>\n<div class=\"appium-cr\">\n<img loading=\"lazy\" width=\"1560\" height=\"940\" src=\"\/en\/wp-content\/uploads\/sites\/2\/img003-3.png\" alt=\"\" class=\"alignleft size-full wp-image-96717 appium-img appium-img2\"><\/p>\n<h4 class=\"appium-ttl\">An Appium Environment that Uses New Remote TestKit Features<\/h4>\n<p>By using the features in the June 2018 update, automated testing using Appium is possible without building a Node.js, Appium server, or similar run environment. The only thing user needs to prepare is test script. Moreover, by using this feature, links to a CI environment inside or outside of a company can easily be achieved. You can focus on the task of creating test script. An Appium environment that uses the new features is shown below.<br \/>\nNote: At the time of this release, only devices running Android 4.4 or later and iOS 10.3 or later are supported.\n<\/p><\/div>\n<h3 class=\"appium-ttl appium-cr\">Comparison of Appium Environments<\/h3>\n<p>The following chart compares the three environments listed above.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th><\/th>\n<th>Environment that uses new RTK features<\/th>\n<th>Environment that uses conventional RTK features<\/th>\n<th>Environment that does not use RTK<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Building of a server environment<\/td>\n<td>Not required<\/td>\n<td>Required<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>Client library<\/td>\n<td>Required<\/td>\n<td>Required<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>Physical Test smartphoneDevices<\/td>\n<td>Not required<\/td>\n<td>Not required<\/td>\n<td>Required<\/td>\n<\/tr>\n<tr>\n<td>Test script run location<\/td>\n<td>Local computer<\/td>\n<td>Local computer<\/td>\n<td>Local computer<\/td>\n<\/tr>\n<tr>\n<td>Linksing to toolss other than Appium<\/td>\n<td>Not supported<\/td>\n<td>Supported<\/td>\n<td>Supported<\/td>\n<\/tr>\n<tr>\n<td>Difficulty of Integration with CI linking<\/td>\n<td>Easy<\/td>\n<td>Linking using the Devices need to be used through Thrift API is required<\/td>\n<td>Difficult<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 class=\"appium-ttl\">Resolving Issues<\/h4>\n<p>One of the challenges implementing automated testing within Continuous Integration (CI) tool is testing on physical devices. By using the new Appium features, the test script can now run on physical devices from CI services comparatively more easily than in the past.<\/p>\n<p>Appium test script can run on devices within Remote TestKit from Jenkins or other CI environments built in-house.<\/p>\n<h3 class=\"appium-ttl\">How to Connect Appium Using the New Features<\/h3>\n<p>By just changing the <strong>Capabilities<\/strong> settings for the test script running in the Appium environment on the local computer, the server-side Appium features can be used.<br \/>\nThe following is an explanation using an example test script written in Python. First of all, prepare a PC that Python can works.<\/p>\n<h4 class=\"appium-ttl\">Installing Appium Client Library<\/h4>\n<p>Follow the procedure below to install the Appium client library.<\/p>\n<pre><code>pip3 install Appium-Python-Client==3.1.0\r\nor\r\npip install Appium-Python-Client==3.1.0\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Explanation of the Destination<\/h4>\n<p>When running a test script on a local computer, specify \"https:\/\/gwjp.appkitbox.com\/wd\/hub\" for \"http:\/\/localhost:4723\/wd\/hub\" as the destination for the Appium client (test script).<\/p>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n}\r\noptions = AppiumOptions()\r\nfor k in caps:\r\n    options.set_capability(k, caps[k])\r\nself.driver = webdriver.Remote(\r\n    # 'http:\/\/localhost:4723\/wd\/hub', options=options\r\n    \"https:\/\/gwjp.appkitbox.com\/wd\/hub\", options=options\r\n)\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">User Authentication<\/h4>\n<p>Specify Remote TestKit user name and password or access Token in Capabilities to connect to the Appium client. Also, the access token can be generated from Remote TestKit Software.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>userName<\/td>\n<td>Remote TestKit user name<\/td>\n<\/tr>\n<tr>\n<td>password<\/td>\n<td>Remote TestKit password<\/td>\n<\/tr>\n<tr>\n<td>access Token<\/td>\n<td>Remote TestKit access Token<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code (authenticate with username and password)<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'userName': 'Remote TestKit user name',\r\n    'password': 'Remote TestKit password',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<p><\/code><br \/>\n<strong>\u30fbExample Python code (Authenticate with accessToken)<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'accessToken': 'Remote TestKit access Token',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<p><strong>\u30fbHow to get the access tokens<\/strong><\/p>\n<p>The access tokens can be generated from Remote TestKit software. Click the \"Manage access token\" right side menu. To regenerate the access token, click the regenerate button.<\/p>\n<div><img src=\"\/en\/wp-content\/uploads\/sites\/2\/storage_1.jpg\" alt=\"\" height=\"480\" class=\"alignleft size-full wp-image-205544\"><\/div>\n<div><img src=\"\/en\/wp-content\/uploads\/sites\/2\/2.png\" alt=\"\" width=\"800\" class=\"alignleft size-full wp-image-205544\"><\/div>\n<h4 class=\"appium-ttl\">Selecting a Appium version<\/h4>\n<p>For Android devices, Appium 1.7.2, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.12.0, 1.12.1, 1.13.0, 1.14.0, 1.14.2, 1.15.1, 1.16.0, 1.17.0, 1.17.1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.19.0, 1.19.1, 1.20.0, 1.20.1, 1.20.2, 1.21.0, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 2.0.0, 2.0.1, 2.1.3, 2.2.2, 2.3.0, 2.4.1, 2.5.0, 2.5.1, 2.5.4, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.1, 2.10.2, 2.10.3, 2.11.0, 2.11.1, 2.11.2, 2.11.4, 2.15.0, 2.16.2, 2.18.0, 2.19.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1 runs on Remote Testkit.<br \/>\nFor iOS devices, Appium versions are determined automatically, so capability can not be specified.Please make sure the test script written on your side is compatible with supported versions on Remote TestKIt.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>appiumVersion<\/td>\n<td>Specify from \"1.7.2, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.12.0, 1.12.1, 1.13.0, 1.14.0, 1.14.2, 1.15.1, 1.16.0, 1.17.0, 1.17.1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.19.0, 1.19.1, 1.20.0, 1.20.1, 1.20.2, 1.21.0, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 2.0.0, 2.0.1, 2.1.3, 2.2.2, 2.3.0, 2.4.1, 2.5.0, 2.5.1, 2.5.4, 2.6.0, 2.7.0, 2.8.0, 2.9.0, 2.10.1, 2.10.2, 2.10.3, 2.11.0, 2.11.1, 2.11.2, 2.11.4, 2.15.0, 2.16.2, 2.18.0, 2.19.0, 3.0.1, 3.0.2, 3.1.0, 3.1.1\"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The iOS device cannot specify a detailed version; it is a fixed version that depends on the version of Appium configured on the server to which the iOS device is connected. 1.x and 2.x versions can be switched by specifying the version in Capabilities above, depending on the iOS version. Capabilities above to switch between 1.x and 2.x versions.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>iOS Version<\/th>\n<th>Appium 1.x<\/th>\n<th>Appium 2.x<\/th>\n<th>Appium 3.x<\/th>\n<th>Not specified<\/th>\n<th>xcuitest-driver<br \/>(Appium 2.x)<\/th>\n<th>xcuitest-driver<br \/>(Appium 3.x)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>iOS 26.x<\/td>\n<td>Unavailable<\/td>\n<td>2.18.0<\/td>\n<td>3.1.1<\/td>\n<td>2.18.0<\/td>\n<td>9.10.5<\/td>\n<td>10.18.2<\/td>\n<\/tr>\n<tr>\n<td>iOS 18.x<\/td>\n<td>Unavailable<\/td>\n<td>2.18.0<\/td>\n<td>3.1.1<\/td>\n<td>2.18.0<\/td>\n<td>9.2.4<\/td>\n<td>9.10.5<\/td>\n<\/tr>\n<tr>\n<td>iOS 17.x<\/td>\n<td>Unavailable<\/td>\n<td>2.18.0<\/td>\n<td>3.1.1<\/td>\n<td>2.18.0<\/td>\n<td>9.2.4<\/td>\n<td>9.10.5<\/td>\n<\/tr>\n<tr>\n<td>iOS 16.x<\/td>\n<td>1.22.3<\/td>\n<td>2.18.0<\/td>\n<td>3.1.1<\/td>\n<td>2.18.0<\/td>\n<td>9.2.4<\/td>\n<td>9.10.5<\/td>\n<\/tr>\n<tr>\n<td>iOS 15.x<\/td>\n<td>1.22.3<\/td>\n<td>2.0.0<\/td>\n<td>Unavailable<\/td>\n<td>2.0.0<\/td>\n<td>4.35.0<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td>iOS 14.x<\/td>\n<td>1.22.3<\/td>\n<td>2.0.0<\/td>\n<td>Unavailable<\/td>\n<td>2.0.0<\/td>\n<td>4.27.2<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td>iOS 13.x<\/td>\n<td>1.22.3<\/td>\n<td>Unavailable<\/td>\n<td>Unavailable<\/td>\n<td>1.22.3<\/td>\n<td>-<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td>iOS 12.x<\/td>\n<td>1.19.1<\/td>\n<td>Unavailable<\/td>\n<td>Unavailable<\/td>\n<td>1.19.1<\/td>\n<td>-<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td>iOS 11.x<\/td>\n<td>1.19.1<\/td>\n<td>Unavailable<\/td>\n<td>Unavailable<\/td>\n<td>1.19.1<\/td>\n<td>-<\/td>\n<td>-<\/td>\n<\/tr>\n<tr>\n<td>iOS 10.x<\/td>\n<td>1.19.1<\/td>\n<td>Unavailable<\/td>\n<td>Unavailable<\/td>\n<td>1.19.1<\/td>\n<td>-<\/td>\n<td>-<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4 class=\"appium-ttl\">Selecting a Device<\/h4>\n<p>The device to run Appium can be selected by the device name only or the device name and version. Regular expression can also be used to specify the device name.<\/p>\n<ul>\n<li>The device to be specified can be checked within Remote TestKit Web or client software.<\/li>\n<li>To specify the device name only, specify the capabilities below.<\/li>\n<\/ul>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>platformName<\/td>\n<td>Specify \"Android\" or \"iOS\"<\/td>\n<\/tr>\n<tr>\n<td>deviceName<\/td>\n<td>Specify the device name<br \/>\nDetermined in the following order: \"Match all\" -&gt; \"Match front with space delimiter\" -&gt; \"Match front regular expression\" (not case sensitive)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code (with Nexus 7 specified)<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    platformName: 'Android',\r\n    deviceName: 'Pixel 7',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<ul>\n<li>To specify the device name and version, specify the capabilities below.<\/li>\n<li>After the device name is filtered, the version is determined, and the device is decided.<\/li>\n<\/ul>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>platformName<\/td>\n<td>Specify \"Android\" or \"iOS\"<\/td>\n<\/tr>\n<tr>\n<td>deviceName<\/td>\n<td>Specify the device name<br \/>\nDetermined in the following order: \"Match all\" \u2192 \"Match front with space delimiter\" \u2192 \"Match front regular expression\" (not case sensitive)<\/td>\n<\/tr>\n<tr>\n<td>platformVersion<\/td>\n<td>Specify the version<br \/>\nSpecify the part excluding \"Android\" \"iOS\" in the OS column of the computer client<br \/>\nDetermined in the following order: \"Match all\" \u2192 \"Match front regular expression\"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code (with Pixel 9 version 15 specified)<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'platformName': 'Android',\r\n    'deviceName': 'Pixel 9',\r\n    'platformVersion': '15',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<p><strong>\u30fbExample Python code (with iPhone 16 version 18 specified)<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'platformName': 'iOS',\r\n    'deviceName': 'iPhone 16',\r\n    'platformVersion': '18',\r\n    'udid': 'XXXXXXXX',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Installing the App<\/h4>\n<p><strong>Method 1.<\/strong><\/p>\n<p>Upload apk or ipa file to a public server which can be accessed from Remote TestKit and specify the <strong>Capabilities<\/strong> below.<br \/>\nNote: If necessary, add settings to permit access from Remote TestKit to the internal firewall. To find the access source IP address,  <a href=\"\/en\/testkit\/contact\/\" rel=\"nofollow\">Contact us<\/a>.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>app<\/td>\n<td>Specify the URL of the uploaded apk or ipa<\/td>\n<\/tr>\n<tr>\n<td>bundleId<\/td>\n<td>Specify the bundleId of ipa. Required parameter for ipa.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'app': 'https:\/\/github.com\/remotetestkit\/sample-code\/raw\/master\/appium\/apk\/RTKappium.apk',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<p><strong>Method 2.<\/strong><\/p>\n<p>Log in to the Software version of Remote TestKit and add the apk or ipa at [Device list] - [Menu] - [App Storage settings] from right side menu. Next, specify the following <strong>Capabilities<\/strong>.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>app<\/td>\n<td>Specify the file name of the uploaded apk or ipa<br \/>\nIf multiple files with the same name are uploaded, the latest uploaded file will be used.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'app': 'RTKappium.apk',\r\n    ...\r\n}\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Designation of automatic re-signature features.<\/h4>\n<p>Automatic re-signing is performed when the ipa file is installed. If necessary, automatic re-signing can be switched off by specifying the following Capabilities.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>resigningEnabled<\/td>\n<td>True or False (*Automatic re-signing is switched off when False is specified).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'resigningEnabled': True,\r\n    ...\r\n}\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Checking the Test Screen in Progress<\/h4>\n<p>After connecting to the Appium server, a <strong>snapshotUrl<\/strong> is issued in order to obtain screens. Use <strong>Capability<\/strong> to obtain the <strong>snapshotUrl<\/strong>. The currently running screen can be viewed by opening the <strong>snapshotUrl<\/strong> in a browser.<\/p>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>snapshotUrl = self.driver.capabilities['snapshotUrl']\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Obtaining the Appium server log<\/h4>\n<p>After connecting to the Appium server, a serverLogUrl is issued in order to obtain appium server log. Use Capability to obtain the serverLogUrl. The currently running appium server log can be viewed by opening the serverLogUrl in a browser. The appium log is the latest 10-minutes log. At this time, logs can be obtained only for Android.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>logLevel<\/td>\n<td>Specify \"info\", \"warn\", \"error\", \"debug\". The default value is \"info\"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'logLevel': 'info',\r\n    ...\r\n}\r\n\r\nserverLogUrl = @driver.capabilities['serverLogUrl']\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Forced deletion of Appium sessions<\/h4>\n<p>When an Appium test case is executed, if the session is not deleted normally, such as when an error occurs or the client is forced to terminate, the session will remain, but when the test is performed again with the same terminal specified conditions, the session can be overwritten and the test can be executed again with the same terminal. However, when the test is performed again with the same terminal specification conditions, it is possible to overwrite the session and run the test again with the same terminal. However, since the session is overwritten in this case, it is not possible to test multiple terminals simultaneously with the same capability. If you wish to test multiple terminals simultaneously, set the \"noSessionOverwriting\" capability to true (boolean). This will ensure that the terminal being used in the Appium Gateway session is skipped from the terminal selection and the session will not be overwritten.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>noSessionOverwriting<\/td>\n<td>Specify either true or false. Default value is false.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'noSessionOverwriting': True,\r\n    ...\r\n}\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Automatic Return of a Rented Device<\/h4>\n<p>If the same device is not accessed via the Appium server for the specified time, it will be returned automatically. If not specified, it will be returned automatically after 10 minutes.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Capabilities name<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>deviceKeepingTimeout<\/td>\n<td>Notation of \"300000 to 1800000\" [milliseconds]. Specify a time between 5 and 30 minutes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'deviceKeepingTimeout': 15 * 60 * 1000,\r\n    ...\r\n}\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Automatic Extension of a Rented Device<\/h4>\n<p>If the same device is accessed via the Appium server with less than ten minutes of rental time left, rental time is automatically extended by 30 minutes.<\/p>\n<h4 class=\"appium-ttl\">Forced return of a Rented Device<\/h4>\n<p>The Rented Device is automatically returned when not in use, but if you want to perform automatic verification on another Device immediately, you can forcibly return the Device. A returnDeviceUrl is issued while running the test code. You can forcibly return the device by using the capability to get the returnDeviceUrl and accessing the corresponding URL in the test code.<\/p>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>returnDeviceUrl = self.driver.capabilities['returnDeviceUrl']\r\nexec_command = 'curl ' + returnDeviceUrl\r\nsubprocess.Popen(exec_command, shell=True)\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Running on latest Chrome Driver<\/h4>\n<p>If it does not work with the latest Chrome Driver, you need to add the following setting to Capability.<\/p>\n<p><strong>\u30fbExample Python code<\/strong><\/p>\n<pre><code>caps = {\r\n    ...\r\n    'chromeOptions': {'w3c': False},\r\n    ...\r\n}\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">A Python Test Script that Performs a Google Search<\/h4>\n<p>Save the following test script with the name of <strong>test.py<\/strong> or the like to the local computer.<\/p>\n<pre><code>import os\r\nimport sys\r\nimport unittest\r\n\r\nfrom time import sleep\r\nfrom appium import webdriver\r\nfrom selenium.webdriver.common.by import By\r\nfrom appium.options.common import AppiumOptions\r\nimport warnings\r\n\r\n# get userName, password from Environment variable\r\nRTK_USERNAME = os.environ.get('RTK_USERNAME')\r\nRTK_PASSWORD = os.environ.get('RTK_PASSWORD')\r\nif not RTK_USERNAME or not RTK_PASSWORD:\r\n    print(\"Environment variable error\")\r\n    sys.exit()\r\n\r\n\r\nclass OpenUrlTest(unittest.TestCase):\r\n    def setUp(self):\r\n        caps = {\r\n            'userName': RTK_USERNAME,\r\n            'password': RTK_PASSWORD,\r\n            'deviceName': 'Pixel',\r\n            'platformName': 'Android',\r\n            'browserName': 'Chrome',\r\n            'appiumVersion': '2.11.2',\r\n            'automationName': 'UiAutomator2',\r\n            'chromeOptions': {'w3c': False}\r\n        }\r\n        warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\r\n        options = AppiumOptions()\r\n        for k in caps:\r\n            options.set_capability(k, caps[k])\r\n        self.driver = webdriver.Remote(\r\n            \"https:\/\/gwjp.appkitbox.com\/wd\/hub\", options=options\r\n        )\r\n        print(self.driver)\r\n\r\n    def tearDown(self):\r\n        self.driver.quit()\r\n\r\n    def test_google_search(self):\r\n        print(self.driver.capabilities['snapshotUrl'])\r\n        # Open URL\r\n        url = \"https:\/\/www.google.com\/\"\r\n        print(\"Open URL: \" + url)\r\n        self.driver.get(url)\r\n        element = self.driver.find_element(By.CSS_SELECTOR, 'textarea')\r\n        sleep(5)\r\n        self.driver.save_screenshot('capture_01.png')\r\n\r\n        # Input keys\r\n        word = \"Remote testKit\"\r\n        print(\"Input Keys: \" + word)\r\n        element.send_keys(word)\r\n        element.submit\r\n        sleep(5)\r\n        self.driver.save_screenshot('capture_02.png')\r\n\r\n        # Get value\r\n        value = self.driver.find_element(By.CSS_SELECTOR, 'textarea').get_attribute('value')\r\n        print(\"Text field value=\" + value)\r\n        self.assertEqual(value, \"Remote testKit\")\r\n\r\n\r\nif __name__ == '__main__':\r\n    suite = unittest.TestLoader().loadTestsFromTestCase(OpenUrlTest)\r\n    unittest.TextTestRunner(verbosity=2).run(suite)\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">A Python Test Script that Performs a Calculation on iPhone device<\/h4>\n<p>Save the following test script with the name of <strong>test.py<\/strong> or the like to the local computer.<\/p>\n<pre><code>import os\r\nimport sys\r\nimport unittest\r\n\r\nfrom appium import webdriver\r\nfrom appium.webdriver.common.appiumby import AppiumBy\r\nfrom appium.options.common import AppiumOptions\r\nimport warnings\r\n\r\n# get userName, password from Environment variable\r\nRTK_USERNAME = os.environ.get('RTK_USERNAME')\r\nRTK_PASSWORD = os.environ.get('RTK_PASSWORD')\r\nif not RTK_USERNAME or not RTK_PASSWORD:\r\n    print(\"Environment variable error\")\r\n    sys.exit()\r\n\r\n\r\nclass OpenUrlTest(unittest.TestCase):\r\n    def setUp(self):\r\n        caps = {\r\n            'userName': RTK_USERNAME,\r\n            'password': RTK_PASSWORD,\r\n            'logLevel': 'info',\r\n            'platformName': 'iOS',\r\n            'deviceName': 'iPhone 7.*',\r\n            'platformVersion': '12',\r\n            'bundleId': 'com.apple.calculator',\r\n            'automationName': 'XCUITest'\r\n        }\r\n        warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\r\n        options = AppiumOptions()\r\n        for k in caps:\r\n            options.set_capability(k, caps[k])\r\n        self.driver = webdriver.Remote(\r\n            \"https:\/\/gwjp.appkitbox.com\/wd\/hub\", options=options\r\n        )\r\n        print(self.driver)\r\n\r\n    def tearDown(self):\r\n        self.driver.quit()\r\n\r\n    def test_calculator(self):\r\n        print(self.driver.capabilities['snapshotUrl'])\r\n\r\n        driver = self.driver\r\n        self.driver.save_screenshot('capture_01.png')\r\n\r\n        el1 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"1\")\r\n        el1.click()\r\n        self.driver.save_screenshot('capture_02.png')\r\n\r\n        is_lang_english = True\r\n        try:\r\n            el2 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"multiply\")\r\n            el2.click()\r\n        except Exception:\r\n            is_lang_english = False\r\n            el2 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"\u4e57\u7b97\")\r\n            el2.click()\r\n        self.driver.save_screenshot('capture_03.png')\r\n\r\n        el3 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"3\")\r\n        el3.click()\r\n        self.driver.save_screenshot('capture_04.png')\r\n\r\n        el2.click()\r\n        self.driver.save_screenshot('capture_05.png')\r\n\r\n        el3.click()\r\n        self.driver.save_screenshot('capture_06.png')\r\n\r\n        if is_lang_english:\r\n            el4 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"equals\")\r\n            el4.click()\r\n            self.driver.save_screenshot('capture_07.png')\r\n\r\n            el5 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"Result\")\r\n            value = el5.get_attribute('value')\r\n\r\n            print(\"Text field value=\" + value)\r\n            self.assertEqual(value, \"9\")\r\n\r\n            el6 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"clear\")\r\n            el6.click()\r\n            self.driver.save_screenshot('capture_08.png')\r\n        else:\r\n            el4 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"\u8a08\u7b97\u5b9f\u884c\")\r\n            el4.click()\r\n            self.driver.save_screenshot('capture_07.png')\r\n\r\n            el5 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"\u7d50\u679c\")\r\n            value = el5.get_attribute('value')\r\n\r\n            print(\"Text field value=\" + value)\r\n            self.assertEqual(value, \"9\")\r\n\r\n            el6 = driver.find_element(AppiumBy.ACCESSIBILITY_ID, \"\u6d88\u53bb\")\r\n            el6.click()\r\n            self.driver.save_screenshot('capture_08.png')\r\n\r\n\r\nif __name__ == '__main__':\r\n    suite = unittest.TestLoader().loadTestsFromTestCase(OpenUrlTest)\r\n    unittest.TextTestRunner(verbosity=2).run(suite)\r\n<\/code><\/pre>\n<p>When running this test script, set the Remote TestKit user name and password in an environmental variable. Use a terminal to run the following command.<\/p>\n<pre><code>export RTK_USERNAME=xxxx\r\nexport RTK_PASSWORD=xxxx\r\n<\/code><\/pre>\n<h4 class=\"appium-ttl\">Connect to Appium Cloud through Proxy<\/h4>\n<p>Whether or not Proxy support is supported depends on the library in which the test script is written.<br \/>\nFor example, since Python does not support Proxy support by default, use MonkeyPatch as follows.<br \/>\nSet the PROXY_URL in the sample code according to your environment.<\/p>\n<pre><code>import os\r\nimport sys\r\nimport unittest\r\nfrom time import sleep\r\nfrom appium import webdriver\r\nfrom selenium.webdriver.common.by import By\r\nfrom appium.options.common import AppiumOptions\r\n\r\n# ------------------------------------------------------------------------------------------\r\n# The original selenium.webdriver.remote.remote_connection is not implemented to access\r\n# the endpoint via proxy. So We wrote a monkey patch for the proxy.\r\nimport certifi\r\nimport urllib3\r\nfrom selenium.webdriver.remote.remote_connection import RemoteConnection\r\n\r\nRemoteConnection.__org__init__ = RemoteConnection.__init__\r\n\r\n\r\ndef patch_init(self, remote_server_addr, keep_alive=False, ignore_proxy=False):\r\n    print(\"\\nMonkey patch version: selenium.webdriver.remote.remote_connection\")\r\n    RemoteConnection.__org__init__(self, remote_server_addr, keep_alive=keep_alive, ignore_proxy=ignore_proxy)\r\n\r\n    if keep_alive:\r\n        # Define proxy. Default value is squid port.\r\n        PROXY_URL = \"http:\/\/localhost:3128\"\r\n        self._conn = urllib3.ProxyManager(proxy_url=PROXY_URL, timeout=self._timeout)\r\n\r\n        # If basic authentication is required, uncomment the following and define it.\r\n        # headers = urllib3.util.make_headers(proxy_basic_auth=\"userid:password\")\r\n        # self._conn = urllib3.ProxyManager(\r\n        #     proxy_url=PROXY_URL, proxy_headers=headers, cert_reqs='CERT_REQUIRED', ca_certs=certifi.where())\r\n\r\n\r\nRemoteConnection.__init__ = patch_init\r\n# ------------------------------------------------------------------------------------------\r\n\r\n# Specify userName, password to Environment variable\r\nRTK_ACCESSTOKEN = os.environ.get('RTK_ACCESSTOKEN')\r\n\r\nif not RTK_ACCESSTOKEN:\r\n    print(\"Environment variable error\")\r\n    sys.exit()\r\n\r\n\r\nclass OpenUrlTest(unittest.TestCase):\r\n    def setUp(self):\r\n        caps = {\r\n            'accessToken': RTK_ACCESSTOKEN,\r\n            'deviceName': 'Pixel',\r\n            'platformName': 'Android',\r\n            'browserName': 'Chrome',\r\n            'appiumVersion': '1.22.3',\r\n            'automationName': 'UiAutomator2',\r\n            'chromeOptions': {'w3c': False}\r\n        }\r\n        # Specify the endpoint\r\n        options = AppiumOptions()\r\n        for k in caps:\r\n            options.set_capability(k, caps[k])\r\n        self.driver = webdriver.Remote(\r\n            \"https:\/\/gwjp.appkitbox.com\/wd\/hub\", options=options\r\n        )\r\n        print(f\"command_executor={self.driver.command_executor}\")\r\n        print(f\"proxy={self.driver.command_executor._conn.proxy}\")\r\n\r\n    def tearDown(self):\r\n        self.driver.quit()\r\n\r\n    def test_google_search(self):\r\n        # print(self.driver.capabilities['snapshotUrl'])\r\n        # Open URL\r\n        url = \"https:\/\/www.google.com\/\"\r\n        print(\"Open URL: \" + url)\r\n        self.driver.get(url)\r\n        element = self.driver.find_element(By.CSS_SELECTOR, 'textarea')\r\n        sleep(5)\r\n        self.driver.save_screenshot('capture_01.png')\r\n\r\n        # Input keys\r\n        word = \"Remote testKit\"\r\n        print(\"Input Keys: \" + word)\r\n        element.send_keys(word)\r\n        element.submit\r\n        sleep(5)\r\n        self.driver.save_screenshot('capture_02.png')\r\n\r\n        # Get value\r\n        value = self.driver.find_element(By.CSS_SELECTOR, 'textarea').get_attribute('value')\r\n        print(\"Text field value=\" + value)\r\n        self.assertEqual(value, \"Remote testKit\")\r\n\r\n\r\nif __name__ == '__main__':\r\n    suite = unittest.TestLoader().loadTestsFromTestCase(OpenUrlTest)\r\n    unittest.TextTestRunner(verbosity=2).run(suite)\r\n<\/code><\/pre>\n<h3 class=\"appium-ttl\">Rest API<\/h4>\n<h4 class=\"appium-ttl\">Uploading apps to shared storage using the API<\/h4>\n<p>\n    Remote TestKit has an application storage feature. This is the ability to upload application files to storage via the PC client menu.<br \/>\n    As an alternative to this menu, apps can also be uploaded to storage from the command line using the REST API. This is a useful feature for customers and others who are using a CI environment.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Upload the apk \/ ipa file to Remote TestKit storage using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/storage\/xxxxxxxx<\/p>\n<p>Specify the name of the file to be uploaded in xxxxxxxxxx.<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>POST<\/p>\n<p><strong>Example of execution with curl command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nRTK_FILENAME=xxxxxxxx\r\ncurl -u $RTK_USERNAME:$RTK_ACCESSTOKEN -X POST -H 'Content-Type: application\/octet-stream' https:\/\/gwjp.appkitbox.com\/storage\/$RTK_FILENAME --data-binary @\/some\/path\/to\/file\r\n<\/code><\/pre>\n<p><strong>Notes<\/strong><\/p>\n<p>The following notes apply to the use of the API.<\/p>\n<ul>\n<li>It is not possible to specify a file name containing multibytes.<\/li>\n<li>Files with the same hash can be overwritten if uploaded.<\/li>\n<\/ul>\n<h4 id=\"show-storage-app-api\" class=\"appium-ttl\">Retrieve Shared Storage Application List Using the API<\/h4>\n<p>\n    You can retrieve a list of available shared storage applications using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Retrieve a list of shared storage applications available in Remote TestKit using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/storage<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\ncurl -s -u $RTK_USERNAME:$RTK_ACCESSTOKEN https:\/\/gwjp.appkitbox.com\/storage\r\n<\/code><\/pre>\n<p><\/p>\n<h4 id=\"install-storage-app-api\" class=\"appium-ttl\">Shared Storage Application Installation Using the API<\/h4>\n<p>\n    You can install a shared storage application on a rented device from the command line using the REST API.\u00b6\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Install an apk\/ipa file from shared storage on a specified device using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/storage\/$RTK_FILENAME<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>POST<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\nRTK_FILENAME=xxxxxxxx\r\ncurl -s -H \"Authorization: Bearer $RTK_ACCESSTOKEN\" -X POST \"https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/storage\/$RTK_FILENAME\"\r\n<\/code><\/pre>\n<p><strong>Note<\/strong><\/p>\n<ul>\n<li>When installing an ipa file with re-signing, add \"?resign=true\" after \"applications\" in the URL.<\/li>\n<\/ul>\n<p><\/p>\n<h4 id=\"delete-storage-app-api\" class=\"appium-ttl\">Shared Storage Application Deleting Using the API<\/h4>\n<p>\n    You can delete applications from shared storage using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Delete a shared storage application from Remote TestKit using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/storage\/$RTK_FILENAME<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>DELETE<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\nRTK_FILENAME=xxxxxxxx\r\ncurl -s -H \"Authorization: Bearer $RTK_ACCESSTOKEN\" \"https:\/\/gwjp.appkitbox.com\/storage\/$RTK_FILENAME\" -X DELETE\r\n<\/code><\/pre>\n<p><\/p>\n<h4 id=\"instal-app-api\" class=\"appium-ttl\">App Installation Using the API<\/h4>\n<p>\n    You can install an application on a rented device from the command line using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Install an apk\/ipa file on a specified device using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/applications<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>POST<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\ncurl -s -H \"Authorization: Bearer $RTK_ACCESSTOKEN\" -X POST -H 'Content-Type: application\/octet-stream' \"https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/applications\" --data-binary @\/some\/path\/to\/file\r\n<\/code><\/pre>\n<p><strong>Note<\/strong><\/p>\n<ul>\n<li>When installing an ipa file with re-signing, add \"?resign=true\" after \"applications\" in the URL.<\/li>\n<\/ul>\n<h4 id=\"get-devicelist-api\" class=\"appium-ttl\">Retrieve Device List Using the API<\/h4>\n<p>\n    You can retrieve a list of available devices using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Retrieve a list of devices available in Remote TestKit using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/devices<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\ncurl -s -u $RTK_USERNAME:$RTK_ACCESSTOKEN https:\/\/gwjp.appkitbox.com\/devices\r\n<\/code><\/pre>\n<h4 id=\"rental-device-api\" class=\"appium-ttl\">Rent a Device Using the API<\/h4>\n<p>\n    You can rent an available device using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Rent a device from Remote TestKit using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/devices\/$DEVICE_ID\/rental<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>POST<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\ncurl -s -u $RTK_USERNAME:$RTK_ACCESSTOKEN \"https:\/\/gwjp.appkitbox.com\/devices\/$DEVICE_ID\/rental\" -X POST\r\n<\/code><\/pre>\n<h4 id=\"return-device-api\" class=\"appium-ttl\">Return a Device Using the API<\/h4>\n<p>\n    You can return a rented device using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Return a device from Remote TestKit using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/devices\/$DEVICE_ID\/rental<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>DELETE<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\ncurl -s -u $RTK_USERNAME:$RTK_ACCESSTOKEN \"https:\/\/gwjp.appkitbox.com\/devices\/$DEVICE_ID\/rental\" -X DELETE\r\n<\/code><\/pre>\n<h4 id=\"get-device-log-api\" class=\"appium-ttl\">Retrieve Device Logs Using the API<\/h4>\n<p>\n    You can retrieve the logs of a rented device using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Retrieve the logs of a Remote TestKit device using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/device_log<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>GET<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\ncurl -s -u $RTK_USERNAME:$RTK_ACCESSTOKEN -X GET \"https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/device_log\"\r\n<\/code><\/pre>\n<h4 id=\"get-appium-log-api\" class=\"appium-ttl\">Retrieve Appium Logs Using the API<\/h4>\n<p>\n    You can retrieve the Appium logs of a device that has executed an Appium session using the REST API.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Retrieve the Appium logs of a Remote TestKit device using the API.<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/server_logs<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>GET<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\ncurl -s -u $RTK_USERNAME:$RTK_ACCESSTOKEN -X GET \"https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/server_logs\"\r\n<\/code><\/pre>\n<p><strong>Note<\/strong><\/p>\n<ul>\n<li>If you wish to specify a start and end time, append \"?startTime=yyyyMMddHHmmss&endTime=yyyyMMddHHmmss\" after \"server_logs\" in the URL.<\/li>\n<li>The formats supported for startTime and endTime include \"yyyyMMddHHmm\", \"yyyyMMddHHmmss\", \"yyyy\/MM\/dd HH:mm\", and others.<\/li>\n<li>If startTime is not specified, or if a time earlier than the rental start time is specified, logs from after the rental start time will be returned.<\/li>\n<\/ul>\n<h4 id=\"get-device-stats-api\" class=\"appium-ttl\">Getting DeviceStats for a device using the API<\/h4>\n<p>\n    You can use the REST API to retrieve the DeviceStats of a device on rental.\n<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Get the DeviceStatus of a device on rental using the API<\/p>\n<p><strong>URL<\/strong><\/p>\n<p>https:\/\/gwjp.appkitbox.com\/rented-devices\/$DEVICE_ID\/device_stats<\/p>\n<p><strong>Method Type<\/strong><\/p>\n<p>POST, GET<\/p>\n<p><strong>Example Using the curl Command<\/strong><\/p>\n<pre><code>RTK_USERNAME=xxxxxxxx\r\nRTK_ACCESSTOKEN=xxxxxxxx\r\nDEVICE_ID=xxxxxxxx\r\ncurl -s -H \"Authorization: Bearer $RTK_ACCESSTOKEN\" -X POST \"$RTK_APPIUM\/rented-devices\/$DEVICE_ID\/device_stats\/start\"\r\ncurl -s -H \"Authorization: Bearer $RTK_ACCESSTOKEN\" -X POST \"$RTK_APPIUM\/rented-devices\/$DEVICE_ID\/device_stats\/stop\"\r\ncurl -s -H \"Authorization: Bearer $RTK_ACCESSTOKEN\" -X GET \"$RTK_APPIUM\/rented-devices\/$DEVICE_ID\/device_stats\"\r\n<\/code><\/pre>\n<p><\/p>\n<p><strong>Note<\/strong><\/p>\n<ul>\n<li>If you wish to specify a start and end time, append \"?startTime=yyyyMMddHHmmss&endTime=yyyyMMddHHmmss\" after \"server_logs\" in the URL.<\/li>\n<li>The formats supported for startTime and endTime include \"yyyyMMddHHmm\", \"yyyyMMddHHmmss\", \"yyyy\/MM\/dd HH:mm\", and others.<\/li>\n<li>If startTime is not specified, or if a time earlier than the rental start time is specified, logs from after the rental start time will be returned.<\/li>\n<\/ul>\n<p><\/p>\n<h3 class=\"appium-ttl\">Other Sample Codes<\/h3>\n<p>For other languages and test script sample codes, see the following repository.<\/p>\n<p><a href=\"https:\/\/github.com\/remotetestkit\/sample-code\">https:\/\/github.com\/remotetestkit\/sample-code<\/a><\/p>\n<h3 class=\"appium-ttl\">Technical Specifications and Limitations<\/h3>\n<p>As of Feb 2025, features are provided as the beta version. At the time of this release, the following are known limitations:<\/p>\n<ul class=\"appium-ttl\">\n<li>Features that are available to FLAT 3 or more users for free during the beta period.<\/li>\n<li>Due to Appium's specifications, the target devices are limited to devices that support UiAutomator2, Android 4.4 or higher, or iOS 10.3 or higher.<\/li>\n<li>The Appium client library, which is based on Selenium client version 4, will not work, so please use the corresponding older version of the client library.<\/li>\n<li>For iOS devices, Appium versions are determined automatically, so capability can not be specified. Please make sure the test script written on your side is compatible with supported versions on Remote TestKIt.<\/li>\n<li>If the same device is not accessed for 10 minutes via the Appium server, it is automatically returned. Note that multiple scripts can be run on the same device during the 10 minute period because it is not automatically returned.<\/li>\n<li>Processes that burden the server or require a large amount of memory may be forcibly terminated.<\/li>\n<li>If necessary, add settings to permit access from Remote TestKit to the internal firewall. To find he access source IP address, <a href=\"\/en\/testkit\/contact\/\" rel=\"nofollow\">Contact us<\/a>.<\/li>\n<li>W3C protocol is supported.<\/li>\n<li>Operation under proxy environment is not supported.<\/li>\n<\/ul>\n<h3 class=\"appium-ttl\">List of errors that can occur in Remote TestKit Appium Cloud.<\/h3>\n<p>If the test script you run terminates abnormally with an error, the error message generated on the server side is returned via the Appium Client library. The error messages that follow \u2018The environment you requested was unavailable\u2019 and the causes are as follows. Please use this information to modify your test scripts.<\/p>\n<table class=\"table table-striped\">\n<thead>\n<tr>\n<th>Error Message<\/th>\n<th>Cause<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>An unknown server-side error occurred while processing the command. Original error:<\/td>\n<td>Appium Cloud server internal error<\/td>\n<\/tr>\n<tr>\n<td>No 'deviceName' is specified.<\/td>\n<td>Incorrect deviceName in capability.<\/td>\n<\/tr>\n<tr>\n<td>'platformName' is not 'Android' or 'iOS'.<\/td>\n<td>Incorrect platformName for capability.<\/td>\n<\/tr>\n<tr>\n<td>No 'platformName' is specified.<\/td>\n<td>Incorrect platformName for capability.<\/td>\n<\/tr>\n<tr>\n<td>No 'elementName' is specified.<\/td>\n<td>Incorrect Capability elementName.<\/td>\n<\/tr>\n<tr>\n<td>Access to Appium Cloud is limited to FLAT upper rank plans.<\/td>\n<td>No FLAT contract.<\/td>\n<\/tr>\n<tr>\n<td>Installing application failed.<\/td>\n<td>Cannot install an application downloaded from a URL<\/td>\n<\/tr>\n<tr>\n<td>failed to get application response body<\/td>\n<td>Application file downloaded from URL is incorrect<\/td>\n<\/tr>\n<tr>\n<td>Login with access token failed: clientAddress =<\/td>\n<td>access token error<\/td>\n<\/tr>\n<tr>\n<td>Installing application failed.<\/td>\n<td>Application installation error<\/td>\n<\/tr>\n<tr>\n<td>Application file is not uploaded.<\/td>\n<td>Application file not uploaded.<\/td>\n<\/tr>\n<tr>\n<td>User storage is not permitted.<\/td>\n<td>Shared storage error<\/td>\n<\/tr>\n<tr>\n<td>Login for sub-account user failed: loginIdentifier =<\/td>\n<td>Sub-account login error<\/td>\n<\/tr>\n<tr>\n<td>No device is rentable because of no matched device<\/td>\n<td>No devices matching the conditions exist<\/td>\n<\/tr>\n<tr>\n<td>Session is not created<\/td>\n<td>Session establishment failed<\/td>\n<\/tr>\n<tr>\n<td>A session is either terminated or not started<\/td>\n<td>Session terminated or session establishment failed<\/td>\n<\/tr>\n<tr>\n<td>An connection error occurred.<\/td>\n<td>Disconnected<\/td>\n<\/tr>\n<tr>\n<td>Activating the device failed.<\/td>\n<td>Failed device rental<\/td>\n<\/tr>\n<tr>\n<td>Device is not rentable<\/td>\n<td>Failed device rental<\/td>\n<\/tr>\n<tr>\n<td>No device is rentable.<\/td>\n<td>Failed device rental<\/td>\n<\/tr>\n<tr>\n<td>Application file name must contain alphabets only.<\/td>\n<td>File names must be non-alphabetic<\/td>\n<\/tr>\n<tr>\n<td>Destroying old session failed<\/td>\n<td>Failed to destroy old session<\/td>\n<\/tr>\n<tr>\n<td>Connection source IP address is invalid.<\/td>\n<td>Disconnection from unauthorised IP addresses<\/td>\n<\/tr>\n<tr>\n<td>No device is rentable because rented devices reaches the maximum of your plan: maxRentableDeviceCount =<\/td>\n<td>The number of devices on rent has reached the maximum number that can be rented<\/td>\n<\/tr>\n<tr>\n<td>Device is not launchable<\/td>\n<td>Failed to activate the rented device<\/td>\n<\/tr>\n<tr>\n<td>Device is not launchable because its operation was aborted<\/td>\n<td>Failed to activate the rented device<\/td>\n<\/tr>\n<tr>\n<td>Device is unavailabe without known reasons<\/td>\n<td>No devices available for rent<\/td>\n<\/tr>\n<tr>\n<td>a pair of username and password, or an accessToken is required.<\/td>\n<td>login error<\/td>\n<\/tr>\n<tr>\n<td>Login failed because of invalid login identifier: loginIdentifier =<\/td>\n<td>login error<\/td>\n<\/tr>\n<tr>\n<td>Login failed: loginIdentifier =<\/td>\n<td>login error<\/td>\n<\/tr>\n<tr>\n<td>User name is invalid<\/td>\n<td>login error<\/td>\n<\/tr>\n<tr>\n<td>Could not rent a device that meets your criteria<\/td>\n<td>Failed to rent a device matching the criteria<\/td>\n<\/tr>\n<tr>\n<td>You have exceeded the number of sessions you can connect to.<\/td>\n<td>Number of sessions available for connection exceeded<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><br class=\"appium-lastp\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tutorial for Appium Features Overview Appium is a test framework to automate testing on a smartphone or tablet. Previously, automated testing with Remote TestKit was possible using an Appium environment built on a local computer by using the virtual ADB and Xcode connector features. In June 2018 release, Appium test script can now run easily [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":4939,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"doc-template.php","meta":{"content-type":""},"categories":[],"aioseo_notices":[],"acf":[],"_links":{"self":[{"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/pages\/96713"}],"collection":[{"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/comments?post=96713"}],"version-history":[{"count":19,"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/pages\/96713\/revisions"}],"predecessor-version":[{"id":415876,"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/pages\/96713\/revisions\/415876"}],"up":[{"embeddable":true,"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/pages\/4939"}],"wp:attachment":[{"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/media?parent=96713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appkitbox.com\/en\/wp-json\/wp\/v2\/categories?post=96713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}