I'm running test on an app using UIAutomation, but I need a way to uninstall the app in a device (iPhone, iPad, iPod) without using jailbreak.
Currently I´m using fruitstrap to upload the app to a cable connected device using the device UID.
Is there a way thru a command line (yes it MUST be command line) to delete the app from the device?
Use the fantastic mobiledevice tool!
mobiledevice repo on GitHub
It compiles in seconds and it let you interact with the connected iOS devices very easily.
Use ideviceinstaller
To install app: ideviceinstaller -i testApp.ipa
To uninstall app: If you don't know bundle id, first get bundle id
ideviceinstaller -l then
ideviceinstaller -U com.testPackage.testApp
New Kid on the block - ios-deploy MobileDevice was a good tool, however not being actively developed. ios-deploy works great.
Here is the command -
ios-deploy --id <device_id> --uninstall_only --bundle_id com.app.testapp
(ios-deploy is forked from fruitstrap only)
Via command line: uninstall [-i/--id device_id] -b/--bundle bundle.app
Removed the specified bundle identifier (eg com.foo.MyApp) from the specified device, or all attached devices if none are specified.
Used this repository
Note: works with SDK 6.1.3 but not with SDK 6.1.4
For those who still get here by google:
You can installe the ruby gem ios_app_installer (which is a "light" version of ios-deploy) and after installing it use the command
ios_app_installer -b <bundle id> -u
(The device may have to be connected via USB)
Related
I wanted to know if there is a way to get the Bundle Version of a iOS App on the phone connected via USB using the command line (from a Mac running on OSX)?
I have seen a solution in which you need to download the IPA application and then unzip it and read the Info.plist file to find the Bundle Version and bundle version string short but I wanted to know if there is a way or tool to directly get the version from the phone without having to download the App/IPA.
Thank you
You can use the ideviceinstaller utility from libimobiledevice.
You can use the -l flag to list all apps installed on the device. Use the -o xml flag to make the utility list the results in an XML format.
On Mac, you can install ideviceinstaller using Homebrew. On Linux, be aware that the copies of libimobiledevice which ship with the various Linux distributions are usually out of date, so you're better off installing from source.
React-native Custom Objects Identification
Appium inspector is not able to find the child elements of its parent element.
Could any one please help me out
You can try another inspector utility macaca developed in node.js
To install app-inspector, Node.js environment is required.
To install it use below command
$ npm install macaca-cli -g
Your environment needs to be set up for the particular mobile platforms that you want to view.
Install Android SDK for Android, Xcode for iOS. Verify the environment with macaca-cli.
$ macaca doctor
If you saw some green log information, it means your platform environment is ready. Then you can install app-inspector and use it.
Launch
$ app-inspector -u YOUR-DEVICE-ID
iOS
From command line
$ xcrun simctl list
The command above will list all your iOS simulator devices information. You can find the UDID like XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
From Xcode
Open your simulator, choose Hardware - devices - manage devices. You will find the identifier in the device information.
I am currently working on automated testing of Qt-Applications on devices running iOS. So far I am able to install and run these Applications fine, but I am unable to read their output. As far as I understood, reading this issue, Qt uses the gdb server to deliver the output of std::out and std::err to the Qt Creator but I can not get my head around on how to use this information. Besides the bundle identifier, I am given the .ipa-file of the application only. I have access to the applications code but I must not change it.
I use the libmobiledevice libraries to handle all tasks like connection, installation and execution of and on the device.
To summarize: I want to read the debug output of a Qt-written application displayed on my console, like it would be in the "Application output" window of my Creator.
I found a way using the imobiledevice libraries. By calling Idevicedebug -u <uuid> run de.foo.app I was able to execute the application. The qDebug output was prompted to std::out.
As the app crashed when started with a locked screen, I had to check for the display being idle by examining the output of idevicediagnostics ioreg IOPower first.
Now, half a year later, I found a solution that worked both elegant and stable.
I installed the ios-deploy tool using node:
npm install -g ios-deploy
Using this, I was able to install the app and listen to it's output via:
ios-deploy --debug --bundle path/to/my.app
I recieved the full qDebug, std::out and std::err output perfectly fine.
To uninstall the app, I simply added the -9 or --uninstall_only option:
ios-deploy --debug --bundle path/to/my.app --uninstall_only
Using this solution the app could be started reliably, without crashing with a locked screen
I'm building a tool for building an iOS app and running UIAutomation on it. So far I've been targeting the iOS Simulator and I've run into a hiccup moving to running on real devices.
I have a feature where the tool reinstalls the app between each test, so that it always runs from an uninitialized and known state, which currently uses xcrun simctl uninstall and obviously doesn't work for real devices. I'm looking for something similar for real iOS devices.
Another working solution would be to reset the app through some nifty command.
I'm not interested in any UI based solutions, it has to run from a commandline.
iDeviceInstaller supports uninstalling/installing on real devices.
Uninstall:
/usr/local/bin/ideviceinstaller -U <app_bundleID> -u <device_UDID>
Install:
/usr/local/bin/ideviceinstaller -i <pathToIPA> -u <device_UDID>
We wrote an automation bridge in Illuminator that should allow you to send arbitrary commands to your application (in both the simulator and on real hardware).
It is accessed via the command line through a ruby script.
To automate my app, I need to pass some parameters to the built IPA as I deploy it on various devices and run my automation. From various threads I figured I can use "ios-deploy" (https://github.com/phonegap/ios-deploy), a project forked from the fruitstrap project, to successfully deploy an IPA to device via the command line on my terminal. Although ios-deploy documentation suggests it has an option to provide arguments to pass to the app when launching it by using -a or --args, it didn't quite work for me. Rather I am not sure how to read these arguments inside the app. I have tried reading from [[NSProcessInfo processInfo] arguments] as well as NSUserDefaults method (http://perspx.com/archives/parsing-command-line-arguments-nsuserdefaults) and neither are reading the arguments that I am sending to the IPA via ios-deploy -a. These methods work fine if I am building app on XCode and sending arguments (Edit Scheme->Run->Arguments->Arguments passed on launch).
Can someone who has used ios-deploy provide an example on how to use the -a option? Or Is there any other way to launch an IPA (after passing arguments) to a device on the CLI.
I needed this too, so, as I have finally found a solution, I will post it, so that it would be easier to find for everyone.
First, Install http://macappstore.org/ideviceinstaller/
If link is broken - in Terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install ideviceinstaller
Then you can run an already installed app:
idevicedebug run "com.bundle.bundleId" "argument=value" "argument2"
If you have multiple devices connected, provide device UDID for target device:
idevicedebug -u 22296019555853ad916655420ab7596f7a0111 run "com.bundle.bundleId" "argument=value" "argument2"
In your project you then go through all parameters
for(NSString *arg in [[NSProcessInfo processInfo] arguments]){}
But this works on debug versions. If ad-hoc version is installed - can't really launch app (acts like it would have been compiled as ad-hoc from xcode). If debug version is installed - then it all works.
Then there is ios-deploy.
https://github.com/phonegap/ios-deploy
It turns out - they did not intend it to use just to launch app. Each time you need to "install it". (https://github.com/phonegap/ios-deploy/issues/236)
ios-deploy --bundle "/Users/user_name/Desktop/Payload/Device.app" --debug "parameter1,parameter2,parameter_key3=parameter_value3"
(parameters are provided within one string "all_parameters".. how to separate them - up to you.)
Where you encounter the argument string and then you think of a smart way how to deal with it (separate if multiple parameters, etc..)
But also - in ios-deploy case, if ad-hoc version is tested, I experienced problems (app not launching.. crashing etc..) if debug version is used - it's all fine.