ADB equivalent for iOS device
Asked Answered
K

6

33

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?

Keown answered 2/5, 2014 at 14:10 Comment(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.Fund
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.Fulguration
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.Keown
W
11

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.

Wolverine answered 25/3, 2021 at 13:54 Comment(1)
Most of the commands work only for simulators, not for physical devicesMismanage
C
6

UPD: Starting from Xcode 15 (June 2023), Apple has introduced a solution called xcrun devicectl. Unfortunately, at the moment, the utility from Apple has fewer features than those provided by third-party developers. Additionally, with iOS 17, the method of interaction with devices has changed, so not all functions of existing third-party solutions work. As of October 2023, some of these issues have already been resolved in pymobiledevice3.

For devices

For simulators only

Cercaria answered 2/7, 2022 at 20:33 Comment(0)
F
4

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.

Fund answered 4/5, 2014 at 4:28 Comment(4)
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.Keown
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.Keown
@Keown 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.Fund
@Keown 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.Heteropolar
V
3

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

Veedis answered 27/10, 2016 at 20:20 Comment(3)
Could you explain this further please? A single sentence answer isn't likely to be very helpful.Articulation
Whilst this doesn't answer the question asked, it solved my problem! ThanksMarlie
instruments deprecated. Use xcrun xctrace list devicesHiller
A
1

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

adt -devices -platform ios
Adios answered 30/4, 2015 at 21:13 Comment(0)
C
-1

Command for list of available iOS simulators : xcrun simctl list

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

Clearheaded answered 15/4, 2021 at 17:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.