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 :http://quamotion.mobi/iMobileDevice/Download
Once you have installed the binaries, add the path you 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)
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 wil have to 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 wil list all the connected (via USB) Android devices. Note that the device unique identifier is listed, use this when you have several device connected and want to direct a command at a specific device. You normally proceed 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
Pritns 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 instal and run actual pplications on the iOS device, then you must mount a developer disk. The command above does this. You wil need the .dmg and .signature file 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 applciations 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. Yo uneed the developer disk mounted to do this.
idevicediagnostics -u <DUID> restart
Reboot the device.
No comments:
Post a Comment