How to specify Cordova build target in build.json - ios

I'm having an error when I execute cordova build.
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }
Since my app only builds on iPad, I think I need to set a build target to an iPad, but I'm not sure how to do this.
Versions
XCode: Version 11.1 (11A1027)
Cordova: cordova#9.0.0
MacOS: 10.15 Catalina
My config.xml has these tags to specify iPad only:
<preference name="target-device" value="tablet" />
<preference name="deployment-target" value="10.3" />
The full error:
Reading build config file:
No simulator found for ". Falling back to the default target.
Building for "iPhone 11 Pro Max" Simulator (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max, iPhone-11-Pro-Max).
Building project: /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/Sokketsu.xcworkspace
Configuration: Debug
Platform: emulator
Target: iPhone 11 Pro Max
Running command: xcodebuild -workspace Sokketsu.xcworkspace -scheme Sokketsu -configuration Debug -sdk iphonesimulator -destination platform=iOS Simulator,name=iPhone 11 Pro Max build CONFIGURATION_BUILD_DIR=/Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/emulator SHARED_PRECOMPS_DIR=/Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/sharedpch
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/emulator
SDKROOT = iphonesimulator13.1
SHARED_PRECOMPS_DIR = /Users/lucaban/.ghq/github.com/mesqueeb/sokketsu/src-cordova/platforms/ios/build/sharedpch
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }
Available destinations for the "Sokketsu" scheme:
{ platform:iOS Simulator, id:B90FC025-F8EB-40B3-90C5-E9094C0FFD17, OS:13.1, name:iPad Air (3rd generation) }
{ platform:iOS Simulator, id:3131A6AD-3C4E-4CEA-8889-9C7E22EAF816, OS:13.1, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:A8055BC4-F95C-43FA-8B28-7FACBD3D57B6, OS:13.1, name:iPad Pro (11-inch) }
{ platform:iOS Simulator, id:7FAD7B1C-70DD-407A-AC99-3ACAD2670726, OS:13.1, name:iPad Pro (12.9-inch) (3rd generation) }
Ineligible destinations for the "Sokketsu" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
xcodebuild: Command failed with exit code 70

You need to set the target-device to universal and then change it back to tablet in Xcode when finished.
config.xml
<preference name="target-device" value="universal" />
PS: This issue started probably around cordova-ios version 5.0.1 when running cordova build ios command.

You can solve this issue by sending the device name as a buildFlag
If you are using cordova use below command
cordova build ios --buildFlag="-destination platform=iOS Simulator,name=iPad Pro (11-inch)"
For me, I was using this in an Ionic project.
ionic cordova build ios -- --buildFlag="-destination platform=iOS Simulator,name=iPad Pro (11-inch)"
You can choose any device name you want from the list Available destinations listed in your error

As you can see in terminal it says:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }
You can follow below steps:
Go to Xcode
Under simulator target click 'Add Additional Simulators'
Once this screen pops up, click on + icon on bottom left corner
It will display a screen to add new simulator: Add the one for which your build is failing , in this case:iPhone 11 Pro Max, Select Device type as(iPhone 11 Pro Max) and latest OS version.
Go to terminal and try build command again.

Related

Unable to find a destination matching the provided destination specifier

Currently, I am struggling with the following issue and it's kind of big blocker for our project.
We need to run ui tests for apple watch test target in the iOS App with Watch App using terminal and we receive such error, which is quite frustrating
Command I use:
xcodebuild test -workspace WatchTesterApp.xcworkspace -scheme 'Watch' -destination 'id=F35DCC98-0F7D-460E-A49F-A446FD5FB4BE'
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:F35DCC98-0F7D-460E-A49F-A446FD5FB4BE }
The requested device could not be found because no available devices matched the request.
Available destinations for the "Watch" scheme:
{ platform:iOS Simulator, id:F35DCC98-0F7D-460E-A49F-A446FD5FB4BE, OS:14.5, name:iPhone 12 Pro }
Ineligible destinations for the "Watch" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device }
Destination is iPhone's simulator id which is paired with apple watch
Has anyone faced such issue?
So, after a long investigation and a long list of possible fixes that resolved nothing, I updated Xcode and tried to run the same command, which didn't work either and only after creating new clean project using new Xcode it finally worked.
I used:
xcodebuild test -workspace WatchTesterAppExample.xcworkspace -scheme 'WatchTesterAppExample WatchKit App' -destination 'platform=WatchOS Simulator,name=Apple Watch Series 7 - 45mm' &
xcodebuild test -workspace WatchTesterAppExample.xcworkspace -scheme 'WatchTesterAppExample' -destination 'platform=iOS Simulator,name=iPhone 13'
It worked for me on the simulators, didn't try it on real device yet
Interesting fact: I am still able to see this error in some case, especially when I don't specify platform in the 'destination'

How to change destination id for react-native xcodebuild

I new to mac and I'm trying to clone my current WIP react native project (which target for iOS build only) and setup on my new Mac machine. However I constantly hitting following error, I searched everywhere in Xcode xcworkspace, tried quite a number of settings changes (deployment target etc.) and have no idea how to change destination id. Please help. Thanks.
elliotkaliv#Elliots-Mac-mini projNameeeeeeee % yarn ios
yarn run v1.22.10
$ npx react-native run-ios --simulator='iPad Air'
warn Package filenamify has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/elliotkaliv/Documents/prjs/projNameeeeeeee/node_modules/filenamify/package.json
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Found Xcode workspace "projNameeeeeeee.xcworkspace"
info Building (using "xcodebuild -workspace projNameeeeeeee.xcworkspace -configuration Debug -scheme projNameeeeeeee -destination id=DDAF30B3-2CC8-460E-B05A-0E672CE9C59C")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70. To debug build logs further, consider building your app with Xcode.app, by opening projNameeeeeeee.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace projNameeeeeeee.xcworkspace -configuration Debug -scheme projNameeeeeeee -destination id=DDAF30B3-2CC8-460E-B05A-0E672CE9C59C
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:DDAF30B3-2CC8-460E-B05A-0E672CE9C59C }
Available destinations for the "projNameeeeeeee" scheme:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:EFF665D5-5FBC-514A-BBD3-F593B237E458 }
{ platform:iOS Simulator, id:96C0A232-B926-4C02-9DF6-89066487EF8D, OS:14.4, name:iPad (8th generation) }
{ platform:iOS Simulator, id:1F102212-0663-4AC1-8AF3-A6A46059B35C, OS:14.5, name:iPad (8th generation) }
{ platform:iOS Simulator, id:A193D152-0330-4FE5-BF13-874BA3538AC2, OS:14.1, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:F67B9A1B-E43A-47D7-9996-303E37CE9E91, OS:14.5, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:2DDEB0DB-D658-4343-9BBC-A2AE9BDFCBF4, OS:14.1, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:FB9B5898-9892-420B-BB70-67E19CF1BEEE, OS:14.4, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:EB82A729-BD5E-4F70-9F00-AE590AF743D0, OS:14.5, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:C58EB805-AFD9-4FA1-8FA5-EAA4034AA915, OS:14.1, name:iPad Pro (11-inch) (2nd generation) }
{ platform:iOS Simulator, id:E3496671-D43A-4E1A-B33D-476F2022FFB4, OS:14.4, name:iPad Pro (11-inch) (2nd generation) }
{ platform:iOS Simulator, id:0965280C-C978-4721-B720-D51AF187CCA9, OS:14.5, name:iPad Pro (11-inch) (3rd generation) }
{ platform:iOS Simulator, id:29A34DD5-637E-41A8-9F11-B3EA9660083B, OS:14.1, name:iPad Pro (12.9-inch) (4th generation) }
{ platform:iOS Simulator, id:8D1E91AE-D046-43C6-8E56-DC16B01DDCC6, OS:14.4, name:iPad Pro (12.9-inch) (4th generation) }
{ platform:iOS Simulator, id:1C028811-E780-40D1-BDE0-73105A705367, OS:14.5, name:iPad Pro (12.9-inch) (5th generation) }
Ineligible destinations for the "projNameeeeeeee" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
To asnwer my own question, I don't think it is possible to change destination id but simulator name. In my case, I found the correct command is to exactly match my simulator name which is example
npx react-native run-ios --simulator='iPad Air (4th generation)'
to rename a specific simulator name, go to XCODE (example screenshot given is v13.0):
on toolbar: Window > Devices and Simulators
and rename a simulator to a unique name

How to install *.app file to real device by script?

Get device list
xcrun xctrace list devices
=> 'Simson’s iPhone 11 (14.4.2) (00008030-00122CD62291802E)'
Install app file
xcrun simctl install 00008030-00122CD62291802E app/ios/test.app
Then I get error:
stderr: 'Invalid device: 00008020-00151D0101A1002E'
code: 148
FYI,
Other simulator device
iPhone 11 (14.2) (8C7A8554-23D2-4E89-BC42-99A87D550067)
iPhone 11 Pro (14.2) (BE017979-0F60-4C0E-A203-B94951969071)
If I replace 00008020-00151D0101A1002E by 8C7A8554-23D2-4E89-BC42-99A87D550067 or BE017979-0F60-4C0E-A203-B94951969071 will work.
Please help.

React-Native CLI run-ios script attempts to run app on non-existent simulator

xcode 12
react-native cli 4.13.1
cocoapods 1.10.1
react 0.63.4
I've encountered this problem more than once on my project, the first time I ended up rebuilding. I'm not sure what is causing it. When I "run-ios", the simulator is being chosen incorrectly, and attempts to run on a not present device.
:~/source/personal/<project>$; npx react-native run-ios --verbose
debug Reading /Users/<user>/source/personal/<project>/ios/Podfile
debug Reading /Users/<user>/source/personal/<project>/ios/Podfile
debug Reading /Users/<user>/source/personal/<project>/ios/Podfile
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- #react-native-community/geolocation (to unlink run: "react-native unlink #react-native-community/geolocation")
- #react-native-community/picker (to unlink run: "react-native unlink #react-native-community/picker")
- react-native-maps (to unlink run: "react-native unlink react-native-maps")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
debug Reading /Users/<user>/source/personal/<project>/ios/Podfile.lock
info Found Xcode workspace "<project>.xcworkspace"
info Building (using "xcodebuild -workspace <project>.xcworkspace -configuration Debug -scheme <project> -destination id=FCBFA5B8-2A42-4B0F-AC8A-D43A1CC7C08E")
debug Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace <project>.xcworkspace -configuration Debug -scheme <project> -destination id=FCBFA5B8-2A42-4B0F-AC8A-D43A1CC7C08E
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70. To debug build logs further, consider building your app with Xcode.app, by opening <project>.xcworkspace.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace <project>.xcworkspace -configuration Debug -scheme <project> -destination id=FCBFA5B8-2A42-4B0F-AC8A-D43A1CC7C08E
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:FCBFA5B8-2A42-4B0F-AC8A-D43A1CC7C08E }
Available destinations for the "<project>" scheme:
{ platform:iOS Simulator, id:C671E44A-5901-4054-AABE-26394319C7D5, OS:14.4, name:iPad (8th generation) }
{ platform:iOS Simulator, id:FA9E687C-9E94-48E4-8592-BFFA51CFB107, OS:14.4, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:25FF1BD1-D6BF-481C-9B98-2F31417A1A1D, OS:14.4, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:C9EBBEB7-D7C2-460E-AEF7-D0E41EF35051, OS:14.4, name:iPad Pro (11-inch) (2nd generation) }
{ platform:iOS Simulator, id:96529FA3-C77A-4969-8BB4-5FDF0C336630, OS:14.4, name:iPad Pro (12.9-inch) (4th generation) }
{ platform:iOS Simulator, id:EBEB0DE3-6D3E-4AAC-8EF5-AFE9659E72CB, OS:14.4, name:iPhone 8 }
{ platform:iOS Simulator, id:E252FD89-6E65-49DD-8A00-403626444DB5, OS:14.4, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:41237E14-D8AF-4383-BC35-A7065F7F2A46, OS:14.4, name:iPhone 11 }
{ platform:iOS Simulator, id:23AA1BD3-0187-4522-99A8-75526721A2D2, OS:14.4, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:EA72F6D7-B1DB-4EA9-9447-1D3FDFC2DA1A, OS:14.4, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:CE1BFE8D-7326-4B38-A2C1-D91E43D05622, OS:14.4, name:iPhone 12 }
{ platform:iOS Simulator, id:1B59D058-57A5-4A8C-AA87-8FB531318C02, OS:14.4, name:iPhone 12 Pro }
{ platform:iOS Simulator, id:AE03D9A6-8D32-4F5F-AB34-AB91CD0E925B, OS:14.4, name:iPhone 12 Pro Max }
{ platform:iOS Simulator, id:9A59AE8D-695A-4882-9E32-5D053B1BCEA6, OS:14.4, name:iPhone 12 mini }
{ platform:iOS Simulator, id:8CBF1BCA-5731-4868-B726-38DC1EB527F1, OS:14.4, name:iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:88114D51-5164-4C7F-BFA6-354FC6B4B22C, OS:14.4, name:iPod touch (7th generation) }
Ineligible destinations for the "<project>" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
By digging into the scripts, I've found that the following code from <project>/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js chooses the simulator:
async function runOnSimulator(xcodeProject, scheme, args) {
let simulators;
try {
simulators = JSON.parse(_child_process().default.execFileSync('xcrun', ['simctl', 'list', '--json', 'devices'], {
encoding: 'utf8'
}));
} catch (error) {
throw new (_cliTools().CLIError)('Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.', error);
}
/**
* If provided simulator does not exist, try simulators in following order
* - iPhone X
* - iPhone 8
*/
const fallbackSimulators = ['iPhone X', 'iPhone 8'];
const selectedSimulator = fallbackSimulators.reduce((simulator, fallback) => {
return simulator || (0, _findMatchingSimulator.default)(simulators, {
simulator: fallback
});
}, (0, _findMatchingSimulator.default)(simulators, args));
if (!selectedSimulator) {
throw new (_cliTools().CLIError)(`No simulator available with ${args.simulator ? `name "${args.simulator}"` : `udid "${args.udid}"`}`);
}
...
but I am having a hard time understanding the code and figuring out why it's failing. Clearly, from here, I can hack in the target simulator I want to use, but I'd rather figure out where that's being cached and clear it out. Help?
To solve this issue, all I had to do was go to Xcode > Window > Devices and Simulators, and delete the offending simulator.

Running Cucumber on device, app immediately crashes, error: "Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError"

So I started building my local iOS device environment.
I have got my Simulator environment fully set up and running.
I have got my distribution and provisioning profile set up correctly to the app through the iOS developer.
While trying to run the app, I follow these steps:
Connecting my iPhone 4s (iOS 8.4.1) with USB cable to my Mac.
Searching for my device in the Terminal with the following command:
xcrun instruments -s devices
The output is:
Known Devices:
Oved's iMac [2E984C21-8F30-5B90-9844-C49F071F8433]
QA1 (8.4.1) [7640b16200d8c553efda3de85291253e95d229ce]
Apple TV 1080p (9.0) [336265EC-E047-4489-9896-03CB47382325]
iPad 2 (8.4) [12A95700-E253-4CF8-ADA7-D9BD4FBE51A9]
iPad 2 (9.0) [72D123E8-8140-41C6-B80C-31F8DA57DCB7]
iPad 2 (9.1) [7EAA1D9F-C4E7-4232-B754-B5FB10A29DDE]
iPad Air (8.4) [7210E244-F1E2-4BD5-92B6-F57E59B1D988]
iPad Air (9.0) [996AA70D-BFE2-48F3-AF96-98BAA453B43B]
iPad Air (9.1) [46D290BB-B89E-4F96-8134-BDE208EE793E]
iPad Air 2 (9.0) [8EA4A50B-D8A7-44C7-9E94-01DDDF3CC494]
iPad Air 2 (9.1) [77E90261-FB18-4B76-81C6-CDB5D5F0206D]
iPad Pro (9.1) [59474C51-4A80-433F-92FE-4A72E6324EFA]
iPad Retina (8.4) [4A4E0612-3BCC-4D09-9DFB-6CAEBD7A39FE]
iPad Retina (9.0) [BF1499FA-2399-48E0-94BC-D9CB92203656]
iPad Retina (9.1) [5DF2678B-AD5D-4C83-9BCF-500901E82A21]
iPhone 4s (8.4) [D130373E-9BD6-46BB-A119-4D0DB572E2EE]
iPhone 4s (9.0) [54C0853C-A2EB-4056-A6D1-69897F4E129E]
iPhone 4s (9.1) [13AEB071-8DB6-433F-9DEE-7354ACB5DD66]
iPhone 5 (8.4) [764C88BF-6E68-4EFA-B4F3-43CECE650D83]
iPhone 5 (9.0) [A6330DF5-1234-45E4-9C50-8360AD277133]
iPhone 5 (9.1) [E1B14CC6-33AA-430C-8C7D-33285F1854C5]
iPhone 5s (8.4) [0A271188-66AB-45F3-97A9-551EAD033509]
iPhone 5s (9.0) [BDD8A84E-1193-4945-9D75-7C812303BA61]
iPhone 5s (9.1) [F540230C-6CA3-4AC5-83C5-08646A14DBD3]
iPhone 6 (8.4) [60724F5F-F91E-4358-B02C-C3BFFC4E0D45]
iPhone 6 (9.0) [159105BB-0C5B-471A-B0B3-C0F29433D7FC]
iPhone 6 (9.1) [BD8D0506-AD7D-44DE-861F-31AE875540D3]
iPhone 6 Plus (8.4) [0FD52166-86F3-4A42-9B60-0BC4F0AB229F]
iPhone 6 Plus (9.0) [B869364C-9BD4-40EA-B856-E92733256F90]
iPhone 6 Plus (9.1) [76CB8D84-A43C-47EC-ADAB-27AAAFA1EC35]
iPhone 6s (9.0) [AC299644-A221-4258-B61E-98D4C5E2DB01]
iPhone 6s (9.1) [90B8A72B-B98D-497F-B4EE-D3B57B6B4D0B]
iPhone 6s (9.1) + Apple Watch - 38mm (2.0) [6D03FF30-74B9-4DD1-A90B-309353F74B49]
iPhone 6s Plus (9.0) [1D797C85-8848-470B-A0AC-42D081BE2DBF]
iPhone 6s Plus (9.1) [96622DF5-2F94-40F4-9C0C-D30ADF3F0ECB]
iPhone 6s Plus (9.1) + Apple Watch - 42mm (2.0) [D428E666-334B-423A-806B-6775FF8FE7BA]
My physical device is called QA1.
My next step was to build and compile my app on Xamarin for testing.
I have searched the .ipa file in my finder, changed it's extension to .zip and then could see my .app file.
I have got the .app file exported as my app bundle path in this command:
export APP_BUNDLE_PATH="/Users/roishmueli/Mekomi/Mekomi/Mekomi/iOS/bin/iPhone/Testing/2.821/Mekomi/Payload/MekomiiOS.app"
Then I Unlocked my device and ran this command for running the app on the device:
DEBUG=1 BUNDLE_ID="com.kimaia.mekomi" DEVICE_TARGET="7640b16200d8c553efda3de85291253e95d229ce" DEVICE_ENDPOINT=http://192.168.1.40 cucumber
The DEBUG=1 gives me additional output, which is:
/Users/roishmueli/Mekomi/Mekomi/Mekomi/features/step_definitions/calabash_steps.rb:7: warning: Insecure world writable dir /Android/android-sdk-macosx in PATH, mode 040757
Feature: Login
Scenario: Registration # features/1-FirstPage.feature:3
INFO: Using uia strategy: 'host'
DEBUG: Searching for run-loop results with glob: /Users/roishmueli/.run-loop/results/*
DEBUG: Found 6 previous run-loop results
DEBUG: Will delete 1 previous run-loop results
DEBUG: Deleted 1 previous results in 0.001425 seconds
DEBUG: Searching for instruments caches with glob: /Library/Caches/com.apple.dt.instruments/xrtmp__*
DEBUG: Found 5 instruments caches
DEBUG: Will delete 0 instruments caches
DEBUG: Deleted 0 instruments caches in 0.00014 seconds
2015-12-02 11:50:55 +0200 [RunLoop:debug]:
{
:app => "com.kimaia.mekomi",
:args => [],
:bundle_dir_or_bundle_id => "com.kimaia.mekomi",
:bundle_id => "com.kimaia.mekomi",
:device => "com.kimaia.mekomi",
:device_target => "7640b16200d8c553efda3de85291253e95d229ce",
:instruments => #<Instruments 7.1.1>,
:launch_method => :instruments,
:launch_retries => 5,
:log_file => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/run_loop.out",
:no_launch => false,
:no_stop => false,
:relaunch_simulator => true,
:reset => false,
:results_dir => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55",
:results_dir_trace => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/trace",
:script => "/Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/_run_loop.js",
:sdk_version => nil,
:udid => "7640b16200d8c553efda3de85291253e95d229ce",
:uia_strategy => :host,
:xcode => "7.1.1",
:xcode_path => "/Applications/Xcode.app/Contents/Developer"
}
EXEC: xcrun instruments -s templates
Starting on 7640b16200d8c553efda3de85291253e95d229ce App: com.kimaia.mekomi
2015-12-02 11:50:56 +0200 [RunLoop:debug]: xcrun instruments -w 7640b16200d8c553efda3de85291253e95d229ce -D /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/trace -t Automation com.kimaia.mekomi -e UIARESULTSPATH /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55 -e UIASCRIPT /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/_run_loop.js >& /Users/roishmueli/.run-loop/results/2015-12-02_11-50-55/run_loop.out
2015-12-02 11:50:56 +0200 [RunLoop:debug]: Preparation took 0.877732 seconds
Then every 30 seconds I get this:
2015-12-02 11:51:26 +0200 [RunLoop:debug]: Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
2015-12-02 11:51:26 +0200 [RunLoop:debug]: Failed to launch. Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError: Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError
I get these logs 5 times and then there is a timeout with this message:
Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
Calabash::Cucumber::Launcher::StartError:
"Timed out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
Logfile: /Users/roishmueli/.run-loop/results/2015-12-03_10-58-35/run_loop.out
2015-12-03 10:58:37.013 instruments[86757:6604129] Failed to start Instruments daemon on 'QA1 (8.4.1)' (The service is invalid.)
Instruments Usage Error : Specified target process is invalid: com.kimaia.mekomi
instruments, version 7.1.1 (59040)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
(Calabash::Cucumber::Launcher::StartError)
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:778:in `new_run_loop'
/Library/Ruby/Gems/2.0.0/gems/calabash-cucumber-0.16.4/lib/calabash-cucumber/launcher.rb:635:in `relaunch'
/Users/roishmueli/Mekomi/Mekomi/Mekomi/features/support/01_launch.rb:27:in `Before'
Then I see the first page # features/step_definitions/calabash_steps.rb:13
Then I press on the verify button # features/step_definitions/calabash_steps.rb:23
Failing Scenarios:
cucumber features/1-FirstPage.feature:3 # Scenario: Registration
1 scenario (1 failed)
2 steps (2 skipped)
2m35.735s
I have enabled my UIAutomation on my Device, through the developer settings and through the instruments.app.
I have tried multiple different APP_BUNDLE_PATHs but none of them seem to fix this.
What am I missing?
Thanks in advance.
+100 for a good report.
APP_BUNDLE_PATH="/Users/roishmueli/Mekomi/Mekomi/Mekomi/iOS/bin/iPhone/Testing/2.821/Mekomi/Payload/MekomiiOS.app"
When testing against physical devices, you don't need to set the APP or APP_BUNDLE_PATH; it will be ignored. Further, I want to make sure that you understand that this .app is only for physical devices; you could not use this .app on a simulator.
Is the .ipa installed on the target device? My guess it is not and that is the cause of this error. Calabash iOS cannot install ipas on devices.
Here is a link to everything you need to know about testing on physical devices.
Testing on Physical Devices
To see more about Environment Variables, see the API Documentation.
If you have an .app and you need to generate a .ipa, we recommend using xcrun ditto - here is an example.

Resources