taking screenshot of real IOS device via macbook command line - ios

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.

Related

Run flutter app on iOS from android studio

So I'm trying to build an app on flutter SDK using the android studio platform and now I want to run it on an iOS device. I've serched on google like 1h but I couldn't find anything(they only said how to run it on MAC which I don't have) . Is there any way how can I run the app from my android studio (or output the iOS app like the android app file which I can find in the project folder?)
I believe your asking how to run your app on a physical iOS device which you can find on flutters website scroll down a little past half way and you will see a section called deploy to iOS devices. Since you don't have a mac testing on a physical device would be your only other option because you can not run a iOS simulator on anything but a mac computer. Gotta love apple :)
If you are without a mac there are some options to you. I will link to a couple articles below. Your best option is to get access to a mac I understand this isn't an option for everyone.How to sign Flutter apps for iOS automatically without a MacDeveloping and debugging Flutter apps for iOS without a Mac

How do I install the salesforce1 app on my iPad simulator

I'm trying to automate some functionalities of the salesfocre1 app, using Appium.
I have the application on my iPad (real device), but don't know how to connect it with my appium code.
I have the iPad simulator on my Mac but I'm not able to find any installer package files of the Salesforce1 app, to install it on the simulator.
I am not the developer of the above application, so I do not have access to the source code and bundle id, to run it on my XCODE and get it on the simulator.
I've previously done automation on Android using real devices/emulators but it was an easy case where we downloaded the app from play store and were able to test it on the emulator/real device, just wondering how to do the same on iOS. Please help, Thanks in advance.
It simply does not work that easy for iOS.
Since you want to run your Appium tests on real device, you need to build application (.IPA file) from source code or resign the one you have with your Apple developer account.
Then you need to build WebDriverAgent with same provision profile - so that Appium can interact with your application. Only with steps I described it will work.
So in your case:
1. No way to get source code - ask smb to provide developer build, release one in any case may not work with Appium.
2. No need to search - you won't find any installer.
3. No way to get Apple developer account - you have to use 3rd party cloud like saucelabs or browserstack, they will resign IPA file with theirs profiles and you will be able to run tests in cloud

ADB equivalent for iOS device

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

Black-box testing for IOS devices

I am looking for some tools that would enable an IOS app to be tested in an automated way without necessarily having access to the code (essentially black box testing). Currently I am exploring something like robotium to do just that in Android, but I also need to be able to test IOS apps. Does anyone have any experience or suggestions for doing this in IOS?
You have build in with Xcode Instruments UIAutomation.
But I recommend Appium because it supports Android and iOS.

Automate Screenshots for IOS

I am trying to build a tool that downloads an app from the market or App Store and run it on a device and take screenshots.
I have been successful in doing this on android devices by using monkey runner tool.
Is the same possible for iOS?
Starting with iOS 4.0 you can use UIAutomation to obtain this.
http://developer.apple.com/technologies/iphone/whats-new.html#tools

Resources