30

I was looking some instrument like Android ADB in order to debug iOS devices. I've found iOS instrument, a tool of the XCode that is able to debug app on mobile iOS devices. This instrument is helpful if you have to test your application or some other open source app.

I need to test the iOS device, more than my apps, so I was looking for something like Android ADB for iOS devices.

Is there something like it?

Andry
  • 16,172
  • 27
  • 138
  • 246
user3596455
  • 311
  • 1
  • 4
  • 5
  • 3
    Can you be more specific about what you want to do that Xcode and `lldb` don't provide? These can be used to debug apps on a device, so I'm not sure what `adb` does that you aren't finding in `lldb` and Xcode. – Rob May 02 '14 at 14:17
  • What do you want to test about the device? There are plenty of benchmark apps out there that let you compare speed, graphics performance, etc. between devices. Google found a dozen (with reviews) in an instant. – Caleb May 02 '14 at 14:26
  • I would like to know if it's possible execute a touch on the iOS device, such as input events like "tap", "swipe", "drag", "flick" in similar manner of adb shell for android devices. For example, I would like to execute a touch on any icon (such as settings, or some other icon of the main menu) and I am not interesting to debug my apps, but only to emulate an event in order to debug the device. – user3596455 May 02 '14 at 14:41

6 Answers6

8

As of 2021, there is a tool from facebook that does this sort device automation.

The project is called "iOS Development Bridge" or idb.

idb is a flexible command line interface for automating iOS simulators and devices

For a bit of history, it is a replacement from similar archive project called WebDriverAgent.

From the original question:

I would like to know if it's possible execute a touch on the iOS device, such as input events like "tap", "swipe", "drag", "flick" in similar manner of adb shell for android devices. For example, I would like to execute a touch on any icon (such as settings, or some other icon of the main menu) and I am not interesting to debug my apps, but only to emulate an event in order to debug the device.

idb can do exactly this. It allows to interact with the device.

Examples from the docs:

Tap idb ui tap X Y Taps a location on the screen specified in the points coordinate system. The tap duration can be set with --duration

Swipe idb ui swipe X_START Y_START X_END Y_END Swipes from the specified start point to the end. By default this will be done by a touch down at the start point, followed by moving 10 points at a time until the end point is reached. The size of each step can be specified with --delta.

David
  • 356
  • 4
  • 6
3

You asked:

I would like to know if it's possible execute a touch on the iOS device, such as input events like "tap", "swipe", "drag", "flick" in similar manner of adb shell for android devices. For example, I would like to execute a touch on any icon (such as settings, or some other icon of the main menu) and I am not interesting to debug my apps, but only to emulate an event in order to debug the device.

This sort of testing is done via Instruments. See the Automated UI Testing section of the Instruments User Guide. Also see WWDC 2010 video Automating User Interface Testing with Instruments, which shows some interactive demonstrations of this process. This Cocoa Controls page has many other links, too.

Bottom line, you can use the UI Automation tool in Instruments to automate the testing of your UI. Note, some of us have had issues in iOS 7 with using this on the simulator, but it seems to work fine on physical devices.

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • Dear Rob, thank you so much for your detailed answer. I'll see these links and I hope it will works fine for my tasks. – user3596455 May 05 '14 at 07:18
  • I've seen these links but I have noticed that the solution it's depending on the app and I would like to free me by the debug on application. I have seen libimobiledevice, a software platform able to communicate with iOS devices. So it's possible, for example, take a screenshot on the device independently from the running. Have you ever used this tool or similar? However it seems that it's not possible to send input event to the device, like touch but it's possible to have a detailed log for the activity running on the device, in a similar manner of adb logcat for android device. – user3596455 May 05 '14 at 13:58
  • @user3596455 OK, I think I now understand what you want to do but I know of no way to automate the UI outside of a particular target app. – Rob May 05 '14 at 14:34
  • @user3596455 Rob is correct. You cannot use UIA to automate any app that is not your own. Meaning any app that you don't have source code for. There is a way to automate the Safari app or even some of the other native apps on the simulator but not on a real device. – Ricardo B. May 17 '14 at 07:47
3

To get the list of attached iOS devices, use the command xcrun instruments -s devices.

auspicious99
  • 3,902
  • 1
  • 44
  • 58
GrayJackie
  • 67
  • 1
  • 6
2

For devices

For simulators only

1

If you happen to have Adobe AIR installed with their ADT (Adobe Developer Tool), you can run:

adt -devices -platform ios
auspicious99
  • 3,902
  • 1
  • 44
  • 58
Steve W
  • 71
  • 4
-1

Command for list of available iOS simulators : xcrun simctl list

Command for list of active/running iOS simulators : xcrun simctl list | grep Booted