Having issues with WebDriverAgent - Appium / Xcode - ios

I believe I have messed up WebDriverAgent.xcodeproj in an attempt to launch my app on a device for testing... is there any way to start over, i.e. delete all corresponding files and then reinstall? I do not seem to be able to do this. Thanks!

One suggestion is to uninstall and install appium.
npm uninstall -g appium and
npm install -g appium
Then open WDA xcode project and reconfigure them all.

Related

How to fix expo start throwing "Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; dont know what that is"

I am trying to set up a react-native development environment. I would like to set up an iOS emulator (preferably an iPhone 10) to run my app on. I am using a Macbook Pro 2016 running on MacOS 10.14.3. I have installed my react-native app through the command create-react-native-app (running version 2.0.2). I also have installed XCode running version 10.2(10E125). When I scan the QR code that Expo generates and run it on my iPad or my Android device it works just fine, but when I try to load the iOS emulator by pressing i after expo start it returns the error
Trying to open the project in iOS simulator...
Simulator is installed but is identified as 'com.apple.CoreSimulator.SimulatorTrampoline'; don't know what that is.
Simulator not installed. Please visit https://developer.apple.com/xcode/download/ to download Xcode and the iOS simulator. If you already have the latest version of Xcode installed, you may have to run the command `sudo xcode-select -s /Applications/Xcode.app`
I have already tried running the command sudo xcode-select -s /Applications/Xcode.app
I have also tried running the command xcode-select -r
I have also confirmed that in my XCode->Preferences->Locations Command Line Tools is selected as "Xcode 10.2(10E125)"
None of these have worked.
I am expecting that after pressing i after expo start an iOS emulator loads up. Thank you.
-----EDIT-------
After some more research, I found out that running open -a Simulator and then running expo start loads the app on an emulator and works for my purposes. But still if I just run expo start without running open -a Simulator it still gives the same error. I want to ask if this is the best I am going to get?
You might be running an outdated version of Expo. I had this problem when I was download someone's old repo using Expo 27 when Expo 36 came out. After updating to the latest version, it works.
To update packages in your project, npm-check-updates comes in handy.
npm i -g npm-check-updates # installs ncu globally
ncu -u # updates all dependency versions in your local package.json
npm install # updates the packages in node_modules to match
Note: This will update all your dependencies to the latest version. If you don't want to do this, you can find the latest version of expo and change the version in package.json manually.
I ran into the exact same problem all of a sudden. Clicking "Run on iOS Simulator" within the Expo Developer Browser worked 2 days ago but did not work today. Your clue of using open -a Simulator helped me though. I went into Xcode and clicked the Xcode menu > Open Developer Tool > Simulator. This started the Simulator and then I was able to click "Run on iOS Simulator" within the Expo Developer Browser and it worked as expected. If you haven't had the fortune of "Run on iOS Simulator" working, I'm guessing you could just start a simulator, download Expo from the App Store and just use it from there. None of this answers the question as to why the error happens but at least gives a few workarounds for anyone else that might need. All that matters is you get the app running on the Simulator in the end!

How to run react-native app with hot reload on real ios device?

I'm trying to run my react-native app on my iphone with hot reloading
What shall I do?
I've tried different ip's but it crashes
Run npm install -g ios-deploy to install ios-deploy library globally.
Then use react-native run-ios --device "<device name>" to run your project in your device. Shake the device to get the list of options to enable hot reloading
Changed my IP address to dynamic and now it hot-reloads fine. Thanks

iOS-deploy could not install application exited with code 253

I'm new to Appium and currently being stuck with this issue for a week, hope I can get help here.
The issue is I cannot install my test application on my real iPhone device. It always return the same error.
Encountered internal error running command: Error: Could not install app: 'Command 'ios-deploy --id 20846aec46cd64589f6a2b356ef2390b2bc6bc6c --bundle /var/folders/6p/0y20zycd7qz4q14n42zhq29c0000gn/T/2018616-7145-1norgqb.y7mt/Payload/MyAPP.ipa' exited with code 253'
When I try to run only the ios-deploy command, the error return is:
ios-deploy[10050:85931] [ !! ] Error 0xe8008015: A valid provisioning profile for this executable was not found. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
As my understanding, the iPhone need to be installed the WebDriverAgent before installed the testing application, however, I don't see anything related to install WebDriverAgent on the progress, it just go straight to install the testing application.
Below is my device info:
Appium server: 1.8.1
Device: iPhone 5s (also try with iphone 6) iOS 11
My using Desired capabilities:
{
"platformName": "iOS",
"platformVersion": "11.0.1",
"deviceName": "iPhone 5s",
"automationName": "appium",
"udid": "20846aec46cd64589f6a2b356ef2390b323c6bc6c",
"bundleID": "io.apptest.s",
"app": "/path/to/my/MyAPP.ipa"
}
Yes this is actually really tricky, follow these steps, and You might be able to install Your app.
STEP 1. download driver appium-xcuitest-driver
STEP 2. setup You environment:
After the successful installation now apply these steps carefully. After installation, open terminal and run following commands:
brew install libimobiledevice –HEAD
brew install ideviceinstaller
brew install carthage
npm install -g ios-deploy
gem install xcpretty
After successful installation, the terminal will print BUILT SUCCEEDED on the console so moving on step 03 for web driver protocol configuration
STEP 3.
Now open Xcode and open the XCUITest project that you will get from the following folder in your mac
/Users/someName/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
Once, WebDriver.xcodeproj is opened so make sure that WebDriverAgentLib, WebDriverAgentRunner, and IntegrationApp is showing on the file as below screenshot.
Now select IntegrationApp and simulator as iPhone X and run the application. As the application is deployed successfully and launches o the simulator successfully so now you are good to go with Appium.
Step 4.
Click on Appium application from Launchpad and click on “Start the server v1.7.2″ as the server is started, Click on the “Start Inspector session” to set the required capabilities.
This is bellow for java code, but first try it out with Appium server gui:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “iPhone 7”);
capabilities.setCapability(“platformName”, “IOS”);
capabilities.setCapability(“platformVersion”, “9.3”);
capabilities.setCapability(“browserName”, “safari”);
capabilities.setCapability(“automationName”, “XCUITEST”);
If now is all good to go, write code.
NOTE: Once all is installed and setup, remember to set **automationName as "XCUITest".**
Check sign by
codesign -v --verbose /var/folders/6p/0y20zycd7qz4q14n42zhq29c0000gn/T/2018616-7145-1norgqb.y7mt/Payload/MyAPP.ipa
maybe you can find the answer.

React native runnig error on ios device

I am trying to run react native code to iphone, however it shows the following message.
The following code runs on Android normally, and on expo fine too, but it does not run on physical device.
Please help me.
E:\reactnative\cd webview
E:\reactnative\webview>react-native run-ios
Scanning folders for symlinks in E:\reactnative\webview\node_modules (38ms)
Found Xcode project webview.xcodeproj
spawnSync xcrun ENOENT
E:\reactnative\webview>
If you are using react-native-cli version 0.1.7 then you could either
Rollback to 0.1.7 (do not use '--verbose' argument)
npm install -g react-native-cli#0.1.7
or try it with the latest which might be fixed
npm uninstall -g react-native-cli
npm install -g react-native-cli
There was a regression in 0.1.8, reported here: https://github.com/facebook/react-native/issues/5169

You may not have the required environment or OS to run this project - Cordova - iOS

I'm working with Cordova to build my mobile app. I'm working on a Mac machine and when I try to build and run my app on iOS device, but I'm keep getting this error.
When running:
cordova build ios
output:
** BUILD SUCCEEDED **
then I run
cordova run ios
I get the error
.../ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
If I try to open the project in Xcode and run it, it successfully run on the device.
I notice that before the run failed, it output the message
ios-sim was not found. Please download, build and install 'npm install -g ios-sim'
I'm guessing Cordova thinks the device isn't plugged in since the ios-sim is a simulatur plugin for cordvoa. But I may be wrong.
Any ideas?
(This question is similar to Cordova: You may not have the required environment or OS to run this project, but this question regarding iOS there that Android)
try
npm install -g ios-sim
npm install -g ios-deploy
I suggest you read iOS Platform guide for more info.

Resources