Click here to Skip to main content
15,881,882 members
Articles / Mobile Apps / iOS
Reference

Commands for Controlling an iOS device in Windows using libimobile

Rate me:
Please Sign up or sign in to vote.
4.11/5 (2 votes)
19 Oct 2015CPOL3 min read 34.5K   4   1
From the command line, you can control your iOS device using the libimobile tools, these are some common commands.

Introduction

Download the idevice tools from Quamotion here:

Once you have installed the binaries, add the path to your system path for convenience.

Note that to use most of these device commands, the device itself must be:

  • Supported in terms of the device and the OS version
  • Activated
  • Trusted
  • Have a developer disk mounted (if you want to install/run an app on the device)

All of these operations can be performed from the command line (with the exception of accepting the trust dialog or pairing the device, this requires manual intervention).

If you reboot the device, you must re-pair (or trust) the device. So generally, it's not a great idea to reboot the device, as you will have to be physically present to get it talking again (not very good if you are remotely testing).

Specifying the Device

If you want to direct your command to a specific device, then use the -u (or in some cases -U). Pass in the DUID of the device, and that way if you have several USB connected devices, you can be sure where your command is going. Note to get the DUID, either list all the devices (using idevice_id -l), or go to itunes and click on the Serial Number of the Device and it will show the DUID eventually.

Getting Help

All the commands support the -h optional parameter. Use this to get limited help on the command.

Commands

Here are the commands:

idevice_id -l

This command will list all the connected (via USB) Android devices. Note that the device unique identifier is listed, use this when you have several devices connected and want to direct a command at a specific device. You normally preceed this with a -u, but sometimes it can be a -U so be careful!


ideviceactivation activate -u <DUID> 

This activates the device.


idevicecrashreport -k .

The will copy all the crash reports from the device without deleting them from the device. It will copy all the reports to the specified folder, in this case. (local)


idevicename

Get the name of the device.


ideviceinfo

Prints out various information about the device, including Mac addresses, activation state, CPU type, OS version, etc.


idevicesyslog

Prints the system log from the device. Note this proces will continue to execute and print out each TTY line. If your application spews out TTY, you can capture it from the system log, without having to keep a thread alive that has started your application on the device.


idevicepair pair -u <DUID>

Before you can use a device from a PC, you must trust it. This is a manual process and requires you to accept the trust dialog on the device, this command will instigate that process. Accept the dialog in the GUI and you can now control the device.


idevicepair unpair -u <DUID>

Unpair (un-trust) the device. Note you will not be able to do much with the device if it is unpaired.


idevicepair validate -u <DUID>

Check the status of the device.


ideviceimagemounter -u <DUID> -t Developer DeveloperDiskImage.dmg DeveloperDiskImage.dmg.signature

If you want to install and run actual applications on the iOS device, then you must mount a developer disk. The command above does this. You will need the .dmg and .signature file to get these from your itunes installation folder.


idevicescreenshot

Take a screen shot of the device.


ideviceinstaller -u <DUID> -l -o xml

List all the installed applications on the device. Note that the full path is given, search for any line with .app for the applications on the device.


idevicedebug -u <DUID> run <Identity>

This will run the specified application on the device. You need the developer disk mounted to do this.


idevicediagnostics -u <DUID> restart

Reboot the device.

Conclusion

That's all for now. Happy iOSing

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
Canada Canada
I have a blog here

http://www.electricalengineeringschools.org/blog/

And my robotics web site is here :

http://www.roboticsfordreamers.com/

I have been a software engineer for over 20 years now. I'm an expert in writing scalable restful web API services, which I've been doing for over 7 years now for games companies such as EA and Ubisoft. I've also worked on several video games, including Skate 2 and 3, NHL, Need for Speed, various Assassins Creed games, Far Cry 3 and 4, Driver San Francisco and most recently with a team of 15 on EA's UFC free to play. On this latest project I designed, implemented, tested (including load tests in Gatling and JUnit on AWS), deployed and supported all the web services for the game client, supporting up to a half a million active sessions.

I am proficient at programming in C, C++, C#, Java etc. I've developed many types of games, applications, SDKs and web services in Linux, Unix, iOS, Android and Windows.

My spare time is spent teaching and lecturing computing languages and science. I have a PhD in Artificial Intelligence (specialising in knowledge representation - Semantic networks with inference engines).

Currently I am also building an A.I. general purpose robot. The brains behind it are a mix of 6 Raspberry Pi and Banana Pros, with 2 USB cameras, SATA drive, Router Switch with inter-pi Comms, 2 motorised track systems, plus various sensors including motion/pir/sound etc.

The six pi's are split according to functions, including eyes (image processing/recognition), ears (speech processing and simulated speech),motor (object avoidance, environment mapping, drives all movement), entertainment (web browsing, media playing etc), brain (knowledge system, and adaptive learning/memory systems) and development system ( logging, diagnostics, debugging).

I am available as a consultant, so if you need to get something out the door quick, or want to set down an expandable and resilient framework, ping me !

Comments and Discussions

 
QuestionDownload link broken Pin
Member 954114026-Dec-23 19:49
Member 954114026-Dec-23 19:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.