Automatic appended .xctrunner in my XCUITest bundle id while running on device - xcode

After updating to Xcode 11.3, my all test cases stopped working because of the unnecessary text .xctrunner appended with bundle id.
Example- If I am giving bundle id as abc.com then it's showing abc.com.xctrunner at run time.

XCode 11 changed the format for building xcuitest. To run UI test on device create AppId and Profiles for "$YOUR_TEST_BUNDLE_ID.xctrunner".
Set bundle Id for test target without xctrunner like "$YOUR_TEST_BUNDLE_ID"
Here is my Fastlane match config for iOS and Catalyst.
PRODUCT_BUNDLE_IDENTIFIER = com.test
PROVISIONING_PROFILE_SPECIFIER[sdk=*] = match Development com.test.xctrunner
PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] = match Development com.test.xctrunner catalyst
One Annoying Xcode issues is, Signing & Capabilities for UITest target shows status error. Because profiles don't match but no build error and UI test works just fine. Status error is bit hidden but love to resolve it.

Related

Nativescript - cannot run android on device

I used to be able to run on android and all of a sudden I am getting this error (see below).
The only thing I recall changing is downgrading "nativescript-ui-listview" to "^7.1.0" and "nativescript-ui-sidedrawer" to "~7.0.0" because it otherwise breaks on ios 12.
Webpack compilation complete. Watching for file changes.
Webpack build done!
Project successfully prepared (android)
Installing on device f180a829...
More than one .apk found in /Users/manuelmaestrini/Programming/spiio-development/spiiomobile/platforms/android/app/build/outputs/apk directory. Using the last one produced from build.
Successfully installed on device with identifier 'f180a829'.
Application com.spiio.mobile is not running on device f180a829.
This issue may be caused by:
* crash at startup (try `tns debug android --debug-brk` to check why it crashes)
* different application identifier in your package.json and in your gradle files (check your identifier in `package.json` and in all *.gradle files in your App_Resources directory)
* device is locked
* manual closing of the application
Unable to apply changes on device: f180a829. Error is: Application com.spiio.mobile is not running.
Any idea what might be? I tried to do --clean, remove node_modules, hooks, platforms, uninstall and reinstall webpack etc but no luck...

Xcode 10, WatchKit app and distribution error ITMS-90334 with com.apple.wk

I have a project with WatchKit app inside.
It used to work smooth with Xcode 8 and Xcode 9 with automatic signing and distribution. Xcode 10 broke something.
What I have at the moment is this
The main point here is "com.apple.wk"
It has been added somewhere at the re-signing stage by the organizer as far as I can understand.
I checked my project quadriple and I'm 100% sure it doesn't contain "com.apple.wk" string anywhere.
I switched to manual signing. Created new iOS Distribution certificate. Generated 3 Provision profiles with the correct bundles for app, watch app, watchapp extension. The same error is here.
I tried to clean the project, open\close Xcode, reboot the system. No luck.
I'm unable to dilever my IPA to iTunes with the error above.
I tried to export IPA and distribute it with Application Loader. No luck.
The only one place I found "com.apple.wk" string was in packaging log
2018-09-21 06:54:33 +0000 /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app/Watch/myApp Watch App.app: replacing existing signature
2018-09-21 06:54:34 +0000 /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app/Watch/myApp Watch App.app: signed app bundle with Mach-O universal (armv7k (33554444:1)) [com.apple.WK]
the same time main app and extension have resigned with the correct bundle ids
2018-09-21 06:54:34 +0000 /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app: replacing existing signature
2018-09-21 06:54:34 +0000 /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app: signed app bundle with Mach-O universal (armv7 arm64) [com.myAppBundleName]
&
2018-09-21 06:54:33 +0000 /var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.4mX/Root/Payload/myApp.app/Watch/myApp Watch App.app/PlugIns/myApp Watch App Extension.appex: signed bundle with Mach-O universal (armv7k (33554444:1)) [com.myAppBundleName.watchkitapp.watchkitextension]
Any ideas how to deliver my app are greatly appreciated.
There are two options:
a.
Open EACH target of your project and change Architectures to $(ARCHS_STANDARD)
clean build folder and try to upload as usual. This should allow you to send it automatically via organizer as usual.
b. If above does not work try next:
Click "Archive" with XCode and get xcarchive file
Open archive in Finder
Start distributing to App Store archive through organizer distribute button
Got the error above
Export created ipa file
Open packaging.log file from the export directory
Search for "com.apple.wk" string to find one
Analyze and play a lot with the codesign request from packaging log here it is
/usr/bin/codesign '-vvv' '--force' '--sign' 'B5152DB7C8BC97C444D44341275F5E1B3336BA3B' '--entitlements' '/var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.vsk/entitlements3uMHR5' '--preserve-metadata=identifier,flags,runtime' '/var/folders/gg/jxvtgf9n07s9m0z_vzqlx0c00000gn/T/XcodeDistPipeline.vsk/Root/Payload/myApp.app/Watch/myApp Watch App.app'
Figure out that if i remove this '--preserve-metadata=identifier,flags,runtime' and rerun this code in bash all is going well and binary is signed with the correct bundle id and not with this com.apple.wk
Copy this signed embedded (the path you are able to find in this request above) watch app binary into the xcarchive file created on the first step with replacing the old one.
Start distributing it back with organizer to App Store
Voila it has been uploaded.
Hope it will help someone.

No destinations were specified with the -destination flag which were valid for the specified scheme

My integration bot when trying to run the app on the server complains that...
xcodebuild: error: No destinations were specified with the -destination flag which were valid for the specified scheme 'MyScheme'.
Not sure how to approach this error?
Prior to crashing it does a bunch of searches for different devices...
2014-05-21 14:14:22.631 xcodebuild[49977:100b] [MT] DVTDeviceSearch: Searching for device with type 'iOS Simulator', options: {
OS = "7.1";
name = iPad;
}, genericOnly: NO allowMultiple:NO timeout:0.000000
2014-05-21 14:14:23.134 xcodebuild[49977:100b] [MT] DVTDeviceSearch: Search found devices: (
"<DVTiPhoneSimulator: 0x7ff6fdb9a230> {\n\t\tsessionActive: NO\n\t\tlaunchService: (null)\n\t\tlaunchSucceeded: NO\n\t\tcurrentSimulatorSession: (null)\n\t\tdidExitRecursionGuard: NO\n\t\tdeviceInfo: <DeviceInfo iPad>\n\t\tsimulatedSystemRoot: <DTiPhoneSimulatorSystemRoot 0x7ff6fdb8e6f0> path=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk version=7.1 name=Simulator - iOS 7.1\n\t\tsimulatedDeviceFamily: 2\n\t\tsupportedDeviceFamilies: (\n 1,\n 2\n)\n\t\t}"
)
Checking the servers xcode I can see 6.1 and 7.0 simulator installed.
It also runs fine from xcode.
Your log states it is looking for 7.1 simulators, not 7.0. Either install 7.1 simulators to your Xcode server or downgrade your Deployment Target to 7.0.
I had to update my Xcode Version on our build server.
You can also check, which simulators are available, when you go to
Xcode-> Preferences... -> Components
Make sure the given SDK version was available here. In your case it would be iOS 7.1 simulator. If it was not available, hit the download button.

Xcode Instruments gives this error "Could not start script, target application is not frontmost."

I am using Xcode version 5.0 and trying to use instruments,when i am running the script which contains "var target = UIATarget.localTarget();"
the following error appears :" Could not start script, target application is not frontmost."
It's known issue:
The message “Could Not Start Script : Target app is not frontmost” may be displayed when attempting to capture a UI Automation script in Instruments against the iOS 7 Simulator.
If this occurs, close the trace document and create a new one. 15387075
Source: Xcode 5.0.2 Release notes

Command /usr/bin/codesign failed with exit code 1

I am trying to test a app on my phone. I keep getting this error:
Command /usr/bin/codesign failed with exit code 1
I have added the Provisioning profile and went through the set up on the apple iPhone portal.
I have been looking at this for a little over an hour and a half and I still can't figure it out.
Any ideas why this isn't working and why I am getting this error? Thanks!
Edit:
Here's some information on my build:
CodeSign build/Debug-iphoneos/TableView.app
cd "/flashPics_iPhone BACKUP 2:27"
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: Coulton Vento (LVEE98KDSF)" "--resource-rules=/flashPics_iPhone BACKUP 2:27/build/Debug-iphoneos/TableView.app/ResourceRules.plist" --entitlements "/flashPics_iPhone BACKUP 2:27/build/TableView.build/Debug-iphoneos/TableView.build/TableView.xcent" "/flashPics_iPhone BACKUP 2:27/build/Debug-iphoneos/TableView.app"
/flashPics_iPhone BACKUP 2:27/build/Debug-iphoneos/TableView.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
This is a good resource in figuring out how to setup the provisioning:
http://mobiforge.com/developing/story/deploying-iphone-apps-real-devices
You must download the provisioning profile, the certificate and make sure your iPhone's UDID is registered on those accounts. Then for the Distribution profile you need to specifically tell it in it's setting to use a Distribution Profile to make it build it.
Edit:
Under Project Settings > Select the Configuration your using (Debug, Release, or Distribution) and make sure under Code Signing your Profile appears there.
I fixed that error. The steps are:
GOTO project
select Edit Project setting
in genatel tab project Format select your current Compatible Xcode version and select based SDK for your currunt iPhone Device; for example (iphone device 4.0) then...
build tab:
configuration : Distribution
Base SDK : choose your latest xcode SDK Device
Code signing identity : choose your provisional portal that you alredy created in iPhone Devloper center and you installed so select that particular provisioning.
Any iPhone OS Device : select same as Code signing identity (as mentioned above)
Then next step is go scrolling at below that find Product Name
Product Name : give Product name exactly same as your prodoct name. That's it.
Follow the same steps in configuration :Debug and Release

Resources