Android command line deployment error

Ask general questions here.
priyank1989
Posts: 20
Joined: Wed Aug 14, 2019 8:59 pm

Android command line deployment error

Post by priyank1989 » Mon Sep 30, 2019 8:32 pm

Hi, I am using below command to deploy android application using command line.

Ranorex.Instrumentation.exe /p:android /device:"Nexus 6" /apkfile:"C:\devl\SDK Search_v1.3.0_apkpure.com.apk"

throwing me below error

Error:
Device 'Nexus 6' couldn't be found. Please use the devices dialog to configure your devices.
Last edited by priyank1989 on Tue Oct 01, 2019 8:31 pm, edited 1 time in total.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5360
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Android command line deployment error

Post by odklizec » Tue Oct 01, 2019 9:04 am

Hi,

Have you tried to instrument and deploy APK, using instrumentation wizard? Just to test, if the instrumentation/deployment works at all. If not, then there is most probably a problem with phone connection. Are you sure there is installed proper USB driver on instrumentation machine?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

priyank1989
Posts: 20
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android command line deployment error

Post by priyank1989 » Tue Oct 01, 2019 3:56 pm

yes, I tried instrument and deploy APK, using instrumentation wizard and it is working fine for me, I gone through some steps or workaround about apktool.jar but I didn't find any of the file on given url to replace.

User avatar
N612
Posts: 108
Joined: Mon Jul 11, 2016 4:01 pm

Re: Android command line deployment error

Post by N612 » Tue Oct 01, 2019 4:05 pm

If you manually updated the apktool.jar file, make sure you updated it in all locations. The CLI Ranorex.Instrumentation.exe uses apktool.jar from C:\Program Files (x86)\Ranorex\Studio\Bin\Runtime\RxEnv\Android\Tools\apkTool, while the Wizard (Ranorex.InstrumentationWizard.exe) uses it from C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\Tools\apkTool.

priyank1989
Posts: 20
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android command line deployment error

Post by priyank1989 » Tue Oct 01, 2019 4:27 pm

can you please pass me link from where I can get that apktool.jar and detailed correct steps for workaround of intrument and deploy using command line .
As the link which I follow which don't have apktool.jar and stpes are confusing .

I follow this link

https://www.ranorex.com/forum/instrumen ... 14214.html

User avatar
N612
Posts: 108
Joined: Mon Jul 11, 2016 4:01 pm

Re: Android command line deployment error

Post by N612 » Tue Oct 01, 2019 7:06 pm

That APK tool workaround was included in Ranorex 9.1.2 (release notes). Download 9.1.2 here, install it, and see if it resolves your issue.

priyank1989
Posts: 20
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android command line deployment error

Post by priyank1989 » Tue Oct 01, 2019 8:27 pm

I install 9.1.2, but still facing same issue Device nor found

C:\Program Files (x86)\Ranorex\Studio\Bin>Ranorex.Instrumentation.exe /p:"android" /d:"Nexus 6" /a:"C:\devl\SDK Search_v1.3.0_apkpure.com.apk"

Error:
Device 'Nexus 6' couldn't be found. Please use the devices dialog to configure your devices.

priyank1989
Posts: 20
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android command line deployment error

Post by priyank1989 » Tue Oct 01, 2019 10:36 pm

I tried with latest 9.2.1 still facing same issue of device not found and on other side able to deploy it using wizard

User avatar
Support Team
Site Admin
Site Admin
Posts: 12003
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Android command line deployment error

Post by Support Team » Wed Oct 02, 2019 3:09 pm

I think I know what the issue is. The device "Nexus6" is likely only defined in your solution settings while the CLI instrumentation tool uses machine settings. Solution settings are used in Ranorex Studio when a solution is opened to ensure the same settings are used when copying a solution to another machine. Machine settings stay with the machine and are used by the standalone tools (outside of Ranorex Studio). Check out the link below for more information on the Ranorex settings files.

https://www.ranorex.com/help/latest/ran ... roduction/

To add this device to the machine settings file, open the instrumentation wizard from the start menu (not from Studio), and add the device through there. When the instrumentation wizard is opened from outside of Studio, the settings (and endpoint configurations) are saved to the machine settings file. Once the device is added to the machine settings file, the CLI instrumentation tool should work since "Nexus6" will be defined.

Cheers,
Ned
.
Image

priyank1989
Posts: 20
Joined: Wed Aug 14, 2019 8:59 pm

Re: Android command line deployment error

Post by priyank1989 » Wed Oct 02, 2019 3:27 pm

Great...It works like a charm. you are correct I am adding endpoints from ranorex wizard which is not adding it on machine level ..
Thanks a lot ..