I worked out an "Hello iOS" app by Xcode and can test it by Appium on iOS Simulator. However, I got the following error message when I tried to test the same app on a real iPhone/iPad device.
A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system) (WARNING: The server did not provide any stacktrace information)
Here are my environment.
xcode: 7.0.1
mac os: version 10.11
appium version: 1.4.13
I tried this command "brew install --HEAD ideviceinstaller" but got another error message.
configure: error: in `/private/tmp/xz20151012-43217-o3pk5w/xz-5.2.1':
configure: error: cannot run C compiled programs.
Any solution for it? Thanks!
The problem is solved by running these commands:
cd /usr/local/Library
brew update
brew install ideviceinstaller
Have you enabled Enable UI Automation in device Developer settings panel?
This worked for me using this version 1.4.13
Run in Terminal app:
ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)" <
/dev/null 2> /dev/null
press enter/return key. Wait for the command to finish.
Run:
brew install ideviceinstaller
Related
Recently I created an app in ionic and I wanted to test it in ios. So I run the command ionic cordova emulate ios . But, It is giving me following error.
(node:4200) UnhandledPromiseRejectionWarning: xcodebuild was not found. Please install version 7.0.0 or greater from App Store
I also run following commands but it still shows same error.
npm install -g ios-sim
and
npm install -g ios-deploy
Please guide me what to do.
NOTE: I am using Ubuntu 16.04
You are getting an error because you are running this command on Linux you need macOS to run this command. Hope this will help you :)
Below is the details about my environment and logs of the build failure.
Anyone facing similar issue or know steps to overcome this please do point me out to relevant steps or docs.
Xcode: 7.2.1
Node: v5.9.0
npm: 3.7.3
react-native-cli: 0.1.10
react-native: 0.22.2
Running "sudo react-native run-ios" leaves me with the below logs.
LOGS:
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/abc/Desktop/REACT-NATIVE/demo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/demo.app
No devices are booted.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/demo.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:469:13)
at Object.execFileSync (child_process.js:489:13)
at _runIOS (runIOS.js:83:34)
at runIOS.js:24:5
at tryCallTwo (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/react-native/local-cli/cli.js:86:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:73:7)
do not run:
sudo react-native run-ios
you should run:
react-native run-ios
your root account does not have Simulator configured properly to run the iOS so you see "No devices are booted" error in your log!
I have similar issue on OS X El Capitan v10.11.4
node --version v6.0.0
npm --v 3.8.8
react-native-cli: 0.2.0
react-native: 0.24.1
watchman --v 4.4.0
xcode 7.3
I have created an issue on react-native github.
I was able to resolve my issue:
For me port 8081 was in use :
lsof -n -i4TCP:8081
node 7601 arun 23u IPv6 0xc6b249599e5f1169 0t0 TCP *:sunproxyadmin (LISTEN)
So I followed the instructions from React Native Troubleshooting and killed the pid
kill -9 7601
and ran the command react-native run-ios again and everything worked as expected (on node 6 as well).
Seems you have a wrong path to the Developer directory.
You can check it by running
$ sudo xcode-select -p
Unless you really know what you do, it should points to /Applications/Xcode.app/Contents/Developer.
If that's wrong, try running this command to fix it:
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
FWIW I was having the exact same problem. However, I was using an older version of Xcode (on Yosemite). I had done a complete reinstall of NVM, NPM, and react-native-cli. Nothing worked. In doing so, I also followed a guide to ensure that node was uninstalled cleanly before I reinstalled.
What eventually worked was upgrading OSX itself to allow installation of the latest XCode (7.3 at this time). Now it works perfectly. I am able to run react-native run-ios from the root directory of my project without the need for sudo. As for the sudo issue you might try making sure you are owner of Projects folder. That helped me as well.
So yeah.. I upgraded to OSX 10.11.4 and XCode 7.3. Worked for me.
Good luck.
not sure if this is related but i had to make sure i was on ruby-2.0.0-p648
using a newer ruby gave me similar compilation problems.
I am running appcelerator 4.5.0 and xcode 7.2.1 on Mac OS X 10.10.5
Running an iOS app gives me:
[ERROR] : Xcode EULA has not been accepted.
[ERROR] : Launch Xcode and accept the license.
I ran sudo xcodebuild -license per: "Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." when using GCC
But the error persists.
I then (per: https://wiki.appcelerator.org/display/guides2/Uninstalling+Studio) uninstalled appcelerator by deleting:
/Applications/Aptana Studio 3
/Applications/Titanium Studio
/Application/Appcelerator Studio
and then (per https://archive.appcelerator.com/topic/474/how-do-you-uninstall-titanium-and-appcelerator-studio-completely-and-start-from-scratch):
rm -rf ~/.appcelerator
rm -rf ~/.titanium
sudo npm uninstall -g titanium
sudo npm uninstall -g alloy
sudo npm uninstall -g acs
sudo npm uninstall -g appcelerator
and uninstalled xcode with sudo /Developer/Library/uninstall-devtools --mode=all per: http://osxdaily.com/2012/02/20/uninstall-xcode/
and I deleted Xcode.app from my Applications folder.
After all that I redownloaded xcode via software update, ran sudo xcodebuild -license (typing accept at the end), then installed from the site Appcelerator_Studio.dmg and ran appc setup
But still the error persists.
Any ideas on how to fix?
MORE INFO: After reading https://archive.appcelerator.com/question/155502/using-the-titanium-cli-and-getting-error-you-have-not-agreed-to-the-xcode-license-agreements-please-run-xcodebuild--license I believe I have the same issue (still no resolution though).
Running:
xcodebuild -sdk iphonesimulator is successful but if I run:
appc titanium build -p ios -T simulator -Y iphone I get the same errors as above.
UPDATE based on #andre-m comment (referencing https://apple.stackexchange.com/questions/175069/how-to-accept-xcode-license):
I already mentioned that I have run sudo xcodebuild -license but I also tried:
sudo xcodebuild -license accept which gives no output and then I still give the error on the build;
sudo xcode-select -r no output, error;
sudo xcode-select --install outputs: xcode-select: error: command line tools are already installed, use "Software Update" to install updates but still errors;
sudo softwareupdate -l outputs:No new software available. and then still gives the error;
sudo xcrun cc outputs clang: error: no input files
UPDATE based on #fokke-appcelerator comment (note these results are the same on both a working and non-working machine):
xcodebuild -checkFirstLaunchStatus; echo $?; gives 0
sudo xcodebuild -checkFirstLaunchStatus; echo $?; gives 69
Deleted Xcode.app from Applications (again), reinstalled xcode 7.2.1 -> this time from xcode dmg file How to download Xcode DMG or XIP file? (previously via Software Update), opened Xcode and was not given any EULA dialog.
SOLUTION:
Following #fokke-appcelerator's second I logged the exit code, out, and err of https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/ioslib/lib/xcode.js#L333 (which is located here: /Users/<my_user>/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.GA/node_modules/ioslib/lib) and got: xcodebuild: error: invalid option '-checkFirstLaunchStatus' because that xcode.js script found an older version of Xcode (4.2.6) that was not removed by sudo /Developer/Library/uninstall-devtools --mode=all as it should have.
Removing the old version of Xcode and reinstalling the current version of Xcode and then reinstalling the simulators (Launch Xcode; Select Xcode > Preferences; Select the Downloads icon; Click the Install button next to the desired simulator), and reinstalling Appcelerator ...the problem is now solved.
Just as FYI. I Had same issue and it was because I had downloaded a beta version of xCode but had not opened it (still had current version installed too). Once I opened the beta and went through everything I was able to go back to appc and package app without errors.
We check if the EULA has been accepted here:
https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/ioslib/lib/xcode.js#L332
Which runs:
xcodebuild -checkFirstLaunchStatus
And then checks the exit code.
Could you run the above command yourself and then echo $? to get the exit code? That should echo 1. If that is true, then unfortunately it seems like your Xcode installation has a problem.
Maybe reinstall Xcode and instead of using the terminal to accept the license, just open Xcode.
I don't see where you specifically say it, but like the message says, you did launch XCode since install/update and accept the EULA there, yes?
I have a problem when it comes starting with ionic in Mac. I'll explain the steps I have taken and errors I found, to see if anyone can help me.
I installed node.js from this site: nodejs.org
Thereupon I executed these commands:
$ sudo npm install -g cordova ionic cordova
$ ionic start myApp tabs
$ ionic serve
And with this last order I can see the application running. but if I try to do this:
$ sudo ionic platform add ios
I get this error:
But, These are the versions of the programs I use:
cordova - 3.6.3-0.2.13
Ionic - 1.2.7 Xcode - 6.0.1 (6A317)
XAMPP - 1.8.3-3
Someone could help me solve my problem?
Thank you in advance.
The error message says the problem, "Cordova can only run in Xcode version 4.6 or greater."
You need to install Xcode and the Xcode command line tools. Download Xcode from the AppStore, and run this command in the terminal to get the command line tools.
xcode-select --install
Also do not use sudo with the ionic commands. You'll possibly cause permission issues down the road.
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