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?
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
Github repository
Website
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.
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.
To get the list of attached iOS devices, use the command
xcrun instruments -s devices.
For devices
https://github.com/danielpaulus/go-ios
fork which will probably contribute something https://github.com/testingbot/go-ios
https://github.com/facebook/idb is a powerful tool from Facebook, but a bit tricky to configure
https://github.com/libimobiledevice/libimobiledevice a lot of utilities, in their repositories there are more projects, some of them are included in this one
https://github.com/anonymous5l/iConsole this project just for learning iOS iTunes communication
https://github.com/electricbubble/gidevice-cli
https://github.com/alibaba/taobao-iphone-device python implementation from alibaba
https://github.com/xuan32546/IOS13-SimulateTouch needs jailbreak
https://github.com/iOSForensics/pymobiledevice - libimobiledevice implementation in python
https://github.com/doronz88/pymobiledevice3 - libimobiledevice implementation in python3, active repository
https://github.com/dskrypa/pypod - ipod-enabled
https://github.com/qtacore/pymobiledevice - active fork
https://github.com/YueChen-C/py-ios-device - device info including performance
https://github.com/YueChen-C/java-ios-device - java implementation
fruitstrap - old repo with two popular forks
https://github.com/ios-control/ios-deploy
https://github.com/unprompted/fruitstrap
For simulators only
xcrun simctl - the main tool to control the simulator from apple
https://github.com/appium/node-simctl
https://github.com/phonegap/ios-sim
If you happen to have Adobe AIR installed with their ADT (Adobe Developer Tool), you can run:
adt -devices -platform ios
Command for list of available iOS simulators : xcrun simctl list
Command for list of active/running iOS simulators : xcrun simctl list | grep Booted
Related
Goal:
Connect iOS device (physical device) to macbook
Use Appium / IntelliJ / or any other software to capture app errors from the device
I run automation tests using simulated devices, however, it's proving to not be as affective as manual testing for I'm getting different results. What I want is to simply connect my device to my macbook, run something to log app errors as I interact with my test device.
My current set up to run automated tests:
Appium
IntelliJ - Using simulated devices (No longer wanting to do)
To view what's going on in the device, you'll need to use Xcode. The easiest way to obtain that is to use the Mac App Store application.
If you're able to build your app there is a lot more debugging you can do, but I'm assuming you're not able to do that based on what you've written and won't provide instruction on that.
Attach device
Launch Xcode
Click Window menu
Click Devices and Simulators
Unlock device
Click Open Console if you're looking to see live activity of the system (this is very noisy and unlikely to be of much use) or View Device Logs to see any crash reports.
I am looking for a way to automate the taking of screenshots of ios devices. I read about xcrun but that only works on iphone simulators. In android, there is android ADB which allows the sending of instruction to android device via command line.
Is there any tool / library to help me achieve this ?
You can try this tool Fastlane, I haven't tried it myself though.
You need to write a iOS UI test which captures Screen Shot of your app
Use Fastlane to run those test and store it.
Refer this blog for detailed explanation.
I managed to control my android device with both 'ADB' and 'Appium' on windows system.
Question is : Can I do the same for iPhone ? as i heard that it can't be done in windows platform and it isn't clear on net.
Also wanted to know if the iPhone sdk having tools like ADB 'command line tool' to do some things like make phone call , or press , or swipe ..
I trigger all of that with python scripts.
Thanks
For iPhone automation testing with the help of appium, you must need Mac machine.For iOS app testing using appium, the primary requirement is XCode which comes with only iOS Operating System which you can get only on MacBook/MacMini.
There is no tool like ADB for iOS. Whatever command you want to send to the device, all those needs to be sent through appium driver only. You can check the appium driver, there are lot of in built methods like hiding keyboard or launching app or opening notifications panel etc.
I'd like to test apps on device in the same way like on simulator - app runs on real device but I see screen on mac and I can interact with it using mouse. Im just tired of putting phone to my hand all the time. Developing on windows phone allows it, so It would be nice to have it here. Thank you
John Holdsworth on Remote Xcode plugin:
“Remote is a plugin for Xcode that allows you to control an iPhone
from a window on your Mac during development.”
I just found this. You can control device via mac.
Let's imagine that I have 2 iPhones (or iPads) connected to my Mac and I have to automate a test calling the lldb and loading an app from the COMMAND LINE, not XCODE; so how can I specify which device it should use? Maybe some kind of extra param when calling platform select remote-ios?
lldb does not know how to load apps onto an iOS device, or to start up connections to the debug agent on an iOS device. That bit is done by Xcode, and then the connections are handed off to lldb. Xcode has a fair bit of support for automating test cases for iOS debugging. That's the only supported way to do this at present.