I am trying to run appium automation on iPhone real device. For that I am trying to execute WebDriverAgent (Ref.: https://docs.katalon.com/katalon-studio/docs/installing-webdriveragent-for-ios-devices.html)
I executed these commands in terminal:
cd /usr/local/lib/node_modules/appium/node_modules/appium-webdriveragent
mkdir -p Resources/WebDriverAgent.bundle
sh ./Scripts/bootstrap.sh -d
On executing the last command, I get the error:
Building universal frameworks with common architectures is not possible. The device and simulator slices for "RoutingHTTPServer" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
macOS Version: 10.15.7 (Catalina)
Appium Version: 1.15.1
Related
Hello I'm Beginner in React Native,
I've installed everything did they said.
Now I've created application using below command
react-native init TempApp
Application is created successfully
Now I try to run application using below command
npx react-native run-ios
I got below error
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 /Users/encora/Documents/Paresh\ Workspace/React\ Native\ Projects/TempApp/ios/Pods/YogaKit/YogaKit/Source/YGLayoutExtensions.swift
CompileC /Users/encora/Library/Developer/Xcode/DerivedData/TempApp-fnxepatpnxxjncbfdflpymtfxxag/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/encora/Documents/Paresh\ Workspace/React\ Native\ Projects/TempApp/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Even I try to run application from Xcode also, but I still get error in Xcode also.
Can anyone help me please how to run first react application on Mac
Try this -
Close the Xcode,delete node_modules folder and then run commands in project directory
npm install / yarn install
cd ios && pod install --repo-update
npx react-native run-ios
Option 3 is optional either run project from terminal or from Xcode
After upgrading to Xcode 12, I discovered a project dependency in my larger react-native workspace needs some work to address unsupported architectures.
Until then, I want to continue working on the react-native app, so I installed Xcode 11.7 side-by-side with Xcode 12.
This works fine unless I try to start the app via the CLI tool. It appears the project is still being built by Xcode 12 (the same unsupported architecture errors I saw at compile time are output to the terminal).
which xcodebuild points to /usr/bin/xcodebuild.
What do I need to modify to have version 11.7 run the build command instead of version 12?
You can use xcode-select command to determine at which Xcode version's command line tools the xcodebuild points to:
~ xcode-select -p
/Applications/Xcode.app/Contents/Developer
You can change the selected Xcode version using -s option:
sudo xcode-select -s /Applications/PathToXcode11/Xcode.app
In a larger context I resorted back to creating a blank project and running my build commands.
Same error:
ionic start myApp blank
cd myApp
ionic cordova run ios --debug --target="iPhone-8" --consolelogs
ionic-app-scripts build --target cordova --platform ios
[11:39:29] ionic-app-scripts 3.2.0
[11:39:29] build dev started ...
[11:39:30] clean started ...
[11:39:30] clean finished in 1 ms
[11:39:30] copy started ...
[11:39:30] deeplinks started ...
[11:39:30] deeplinks finished in 15 ms
[11:39:30] transpile started ...
[11:39:33] transpile finished in 3.16 s
[11:39:33] preprocess started ...
[11:39:33] preprocess finished in 1 ms
[11:39:33] webpack started ...
[11:39:33] copy finished in 3.31 s
[11:39:37] webpack finished in 4.35 s
[11:39:37] sass started ...
[11:39:38] sass finished in 1.27 s
[11:39:38] postprocess started ...
[11:39:38] postprocess finished in 10 ms
[11:39:38] lint started ...
[11:39:38] build dev finished in 8.92 s
[11:39:41] lint finished in 2.65 s
> cordova run ios --debug --target iPhone-8
Building for iPhone 8 Simulator
Building project: /myApp/platforms/ios/myApp.xcworkspace
Configuration: Debug
Platform: emulator
Build settings from command line:
CONFIGURATION_BUILD_DIR =
/myApp/platforms/ios/build/emulator
SDKROOT = iphonesimulator12.0
SHARED_PRECOMPS_DIR =
/myApp/platforms/ios/build/sharedpch
Build settings from configuration file '
/myApp/platforms/ios/cordova/build-debug.xcconfig':
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
/myApp/platforms/ios/build/emulator/myApp.app/Info.plist file not found.
[ERROR] An error occurred while running subprocess cordova.
cordova run ios --debug --target iPhone-8 exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
ionic --version
4.1.2
cordova --version
8.0.0 & #latest 8.1.1
XCode Version 10.0 (10A255) + build tools
macOS 10.13.6 - High Sierra. Mojave on a different machine fails the same.
The paths are adjusted if anyone wonders...
-------------- FIX --------------
Together with #DaveAlden's answer this is how I got it back up to do livereload without the bugs:
ionic cordova platform remove ios
sudo npm install -g ionic#3.20.0
ionic cordova platform add ios
open platform/ios/MyApp.xcworkspace
Follow instructions to fall back to legacy build system as on
https://github.com/apache/cordova-ios/issues/407
Run my build script, without the --buildFlag='-UseModernBuildSystem=0'
This problem is caused because Xcode 10 contains a new build system which is currently not compatible with cordova-ios#4 - see here.
The solution for now is to run Cordova with the --buildFlag='-UseModernBuildSystem=0' option to instruct Xcode to use the old build system, e.g.:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
Update: For my own convenience, I've wrapped this in a shell script:
#!/bin/bash
# Adds build flag to make cordova-ios#4 work with Xcode 10
cordova "$#" --buildFlag='-UseModernBuildSystem=0'
I saved this in a file called cordova-xcode10, made sure it's in the path and made it executable (chmod a+x cordova-xcode10), then I can just do:
cordova-xcode10 run ios --target "iPhone-8"
and it will work with Xcode 10
This problem is caused because of Xcode 10.
I resolved this issue by two ways.
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
Create a build.json file on root of project.
In build.json write below code.
{
"ios": {
"debug": {
"buildFlag": ["-UseModernBuildSystem=0"]
},
"release": {
"buildFlag": ["-UseModernBuildSystem=0"]
}
}
}
After that you can run these commands without any error.
ionic cordova build ios
ionic cordova run ios
ionic cordova run ios --target="iPhone-6s" -l
This worked for me
Open your workspace file, then File --> WorkSpace Settings
In shared Workspace settings, choose Build System: Legacy Build System.
Then run ionic cordova run -l
Source(last comment): https://forum.ionicframework.com/t/fresh-ionic-fails-to-emulate-ios-12-info-plist-file-not-found/142291
Update
I just found out that Cordova IOS 5.0.0 was released.
https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html
This worked for me:
cd platforms/ios/cordova && npm install ios-sim#latest
This works for me:
cordova run ios --debug --target "iPhone-8" --buildFlag='-UseModernBuildSystem=0'
only add this flag in you command
cordova run ios --device --buildFlag='-UseModernBuildSystem=0' --verbose
work fine for me
So this is a brand new Mac Air.. running Sierra.
When i run
ionic build ios
i get
** BUILD FAILED **
The following build commands failed:
CompileC /Users/foo/Library/Developer/Xcode/DerivedData/homepocket-gtpsstxtfgknjdgahozlqhgfgmmi/Build/Intermediates/homepocket.build/Debug-iphonesimulator/homepocket.build/Objects-normal/x86_64/AppDelegate.o homepocket/Classes/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/foo/Library/Developer/Xcode/DerivedData/homepocket-gtpsstxtfgknjdgahozlqhgfgmmi/Build/Intermediates/homepocket.build/Debug-iphonesimulator/homepocket.build/Objects-normal/x86_64/MainViewController.o homepocket/Classes/MainViewController.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/cordova/build-debug.xcconfig,-workspace,myproject.xcworkspace,-scheme,myproject,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/build/sharedpch
I installed latest xcode via apple store.
I set the machine to dev mode via xcode ide.
I've ran the emulate through xcode.
I can successfully 'ionic build android' as well as emulate.
I've also run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Because i was seeing
Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
.. mind you all of this is a fresh box from Apple.
After finding this.. https://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232/47
The solution for me was ...
ionic platform remove ios
ionic platform add ios#3.9.2
ionic prepare ios
Then i could build ios.
I'm using xcodebuild install -alltargets -iphoneos4.2 -activeconfiguration provisioning_profile=path_of_my_provisioningprofile code_sign_identity=identity.
This command is building my app and i am getting build file (.app) also.
But how to install the app in to device from command line.
Please help me in this issue.
Fruitstrap is no longer maintained, for a more up to date project checkout the fork by PhoneGap called ios-deploy.
To install run: npm install -g ios-deploy
Here are some examples of how to use it:
// deploy and debug your app to a connected device
ios-deploy --debug --bundle my.app
// deploy and launch your app to a connected device, but quit the debugger after
ios-deploy --justlaunch --debug --bundle my.app
// deploy and launch your app to a connected device, quit when app crashes or exits
ios-deploy --noninteractive --debug --bundle my.app
// Upload a file to your app's Documents folder
ios-deploy --bundle_id 'bundle.id' --upload test.txt --to Documents/test.txt
Fruitstrap:
https://github.com/ghughes/fruitstrap
Here's a good tutorial to set it up:
http://sgleadow.github.com/blog/2011/11/05/installing-ios-apps-on-the-device-from-the-command-line/
Looking around found https://github.com/benvium/libimobiledevice-macosx. This is a port from libimobiledevice to MAC-OS X. Its very useful and no jailbroken is needed. :P
Use this beautiful script : http://gamua.com/blog/2012/03/how-to-deploy-ios-apps-to-the-iphone-via-the-command-line/
- Then connect iphone device via usb to mac running this command
To launch app on command line:
instruments -w 4xxxxxxxx9 -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate NITC -e UIASCRIPT Launch-App.js
format : instruments -w <deviceid> -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <applicationname> -e UIASCRIPT Launch-App.js
My Launch-App.js has only one line - var target = UIATarget.localTarget();
This must be sufficient to launch application on device using command line
What about this:
how to intall an ipa/app file into iPhone with command line?
Third solution with libimobiledevice.
ipatool: https://github.com/majd/ipatool
Step 1: Search the app bundle id
./ipatool search testflight --limit 1
> ==> ℹ️ [Info] Searching for 'testflight' using the 'US' store front...
> ==> ℹ️ [Info] Found 1 result:
> 1. TestFlight: com.apple.TestFlight (3.1.0).
Step 2: Download the IPA
./ipatool download --bundle-identifier com.apple.TestFlight
Easy!
Install following packages on MAC
brew install libimobiledevice
brew install ideviceinstaller
After successfully installed above packages.
Use following command to install .ipa file on iOS devices:
ideviceinstaller -i <Path_to_your_ipa>
Thanks