When I try to start session - Am facing this type of issue on Appium [On provided some capabilities] - appium

An unknown server-side error occurred while processing the command. Original error: Error getting device platform version. Original error: Error executing adbExec. Original error: 'Command ''C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' -P 5037 -s RWCIKB6DFEMB4LGE shell getprop ro.build.version.release' exited with code 1'; Stderr: 'adb.exe: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.'; Code: '1'
REf:
enter image description here

You have to check if your device is authorized: adb devices
If its not authorized then that helped me:
Disconnect USB between PC and device
Stop adb server by entering "adb kill-server" in command window
On device use "Revoke USB debugging authorizations" in "Developer Options"
Reconnect the device to the PC
Open a command window and enter "adb devices". Watch the device's screen for any Authorization message and allow the connection.

Related

How to collect logs from iPhone correctly and how to resolve this error: failed to create archive?

As discussed in WWDC video Explore Logging in Swift, one can use the log collect command to collect device logs from a connected iOS device.
The command looks like this.
sudo log collect --device-name "Someone's iPhone" --start "2022-01-19"
However, I have encountered the following error while running this command
log: failed to create archive: Device not configured (6)
Any hints to resolve this problem?
Thanks
Make sure that the device name does not include apostrophe. So you have to go to Settings -> General -> About -> Name (of your iOS device).
Tap on the name to change name of your device and make sure there is no apostrophe.
So the following command will produce error
sudo log collect --device-name "Bob's iPhone" --start "2022-01-19"
If Bob changed his device name to 'Bobs iPhone' (as discussed above) and wrote in terminal
sudo log collect --device-name "Bobs iPhone" --start "2022-01-19"
It should work
I got this error when the Mac could not connect to the iPhone by WLAN. When I connected it by cable, the error was gone.

Getting 'Device <iOS simulator id> not found!' error message after running ideviceinfo command

Xcode Version 11.3.1 (11C504)
Mojave Version 10.14.4 (18E226)
Steps which I am making:
1. Launch iOS simulator using Xcode.
2. Open terminal and run `ideviceinfo -u :
ideviceinfo -u 175669E4-93EE-413A-83A0-2FEE6B419826
Getting result:
ERROR: Device 175669E4-93EE-413A-83A0-2FEE6B419826 not found!
Other guys get such answer in terminal after repeating my steps:
ideviceinfo -u BFD70ACE-3786-4BEE-B76D-D8D072EBAAC1
Usage: ideviceinfo [OPTIONS]
Show information about a connected device.
-d, --debug enable communication debugging
-s, --simple use a simple connection to avoid auto-pairing with the device
-u, --udid UDID target specific device by its 40-digit device UDID
-q, --domain NAME set domain of query to NAME. Default: None
-k, --key NAME only query key specified by NAME. Default: All keys.
-x, --xml output information as xml plist instead of key/value pairs
-h, --help prints usage information
Known domains are:
com.apple.disk_usage
com.apple.disk_usage.factory
com.apple.mobile.battery
com.apple.iqagent
com.apple.purplebuddy
com.apple.PurpleBuddy
com.apple.mobile.chaperone
com.apple.mobile.third_party_termination
com.apple.mobile.lockdownd
com.apple.mobile.lockdown_cache
com.apple.xcode.developerdomain
com.apple.international
com.apple.mobile.data_sync
com.apple.mobile.tethered_sync
com.apple.mobile.mobile_application_usage
com.apple.mobile.backup
com.apple.mobile.nikita
com.apple.mobile.restriction
com.apple.mobile.user_preferences
com.apple.mobile.sync_data_class
com.apple.mobile.software_behavior
com.apple.mobile.iTunes.SQLMusicLibraryPostProcessCommands
com.apple.mobile.iTunes.accessories
com.apple.mobile.internal
com.apple.mobile.wireless_lockdown
com.apple.fairplay
com.apple.iTunes
com.apple.mobile.iTunes.store
com.apple.mobile.iTunes
Homepage: <http://libimobiledevice.org>
Any ideas what could be wrong? libimobiledevice is installed. 'ideviceinfo -u ' command works correctly with real iOS device.
ideviceinfo (and the other utilities from libimobiledevice) only work with real, physical devices connected to your computer using a USB cable, or over WiFi. They don't work with simulators.
You can list the UDID of all devices with which you can interact via libimobiledevice by running idevice_id -l.

Could not get Simulator application’s pid - Exit status: 70

When using Fastlane to test (Scan tool) an iOS project through Jenkins, I sometimes get the following error:
xcodebuild: error: Failed to build project X with scheme X.
Reason: Could not get Simulator application’s pid
Exit status: 70
This error occurs when the Mac executing xcodebuild/fastlane commands requires a password to be entered into a keychain tool popup.
I haven't found a way of dismissing this over SSH so physically attending the box, unlocking the computer and entering the password into the keychain works for me. A restart just after often helps too.

Flutter - Dartlang: Run Application command fails

When using Atom with the dartlang package, I attempt to use the Dartlang: Run Application command and get the following result:
[/Users/craig/Code/flutter-test/atom1] pub run flutter start
Unable to run on Android.
Unable to run on Android.
Unable to run application - no connected devices.
I get the same thing in the console when running flutter start in the app directory.
My phone is a Nexus 6p that is connected to my computer via USB and has 'USB debugging' enabled in Developer options. How can I get these commands to successfully deploy the app to my device?
Though my device was connected, it was not "authorized". I used the adb devices command to check if it was connected, and the output was something like this:
02:06 PM atom1: adb devices
List of devices attached
8XV5T15A20007972 unauthorized
Note the unauthorized on the last line. After some googling, I learned to go into my phone, and toggle Developer Options > USB debugging from enabled, to disabled, to enabled again. I did this without disconnecting the phone. Re-running adb devices then showed:
02:06 PM atom1: adb devices
List of devices attached
8XV5T15A20007972 device
Note device on the last line instead of unauthorized. I re-ran the Dartlang: Run Application from within Atom and the deploy worked. Somewhere in there, I had to accept the push to device from my phone.
open the device in avd manager and try to run the command again
or you can use your own mobile device just plug your device to your laptop or computer in android you have to enable USB debugging in developer mode setting
or you can build a apk and install it on your device
flutter build

How to run UIAutomation on simulator using Xcode bots - strange behaviour

I would like to run UIAutomation tests on simulator using Xcode bots. I add this command to past-actions script launched after ARCHIVE phase in xcode:
instruments -t "/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate" /Users/ktos/appliation.app -l 10000 -v
Xcode bots log followinng error:
instruments[6702:507] Recording cancelled : At least one target failed to launch; aborting run
Instruments Trace Error : Error Domain=com.apple.instruments Code=1 "Error Starting Recording" UserInfo=0x7fc053b3a310 {NSLocalizedDescription=Error Starting Recording, NSLocalizedRecoverySuggestion=At least one target failed to launch; aborting run}
Instruments Trace Error : Failed to start trace.
When I use exactly the same command in my terminal, on the same computer the instruments runs simulator without any problems. Do you have any idea what could be wrong ?
It may also be possible that Instruments is running in the background. Do a $ps -A and check and kill it.

Resources