Appium: Could not find Automation.tracetemplate when running arc with XCode 6 - appium

Running through the appium tutorial in the section "Starting the Console" for the pre-built iOS app,
I get a stack trace with the error "Could not find Automation.tracetemplate in /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate (Selenium::WebDriver::Error::WebDriverError)"
This is using XCode 6 with the iOS 7.1 simulator installed
How do I point it to the correct location of Automation.tracetemplate?

The .bundle extension is now .xrplugin in XCode 6. The path can be changed under appium/lib/devices/ios/ios.js around line 749.
var xcodeTraceTemplatePath = path.resolve(xcodeFolderPath,
"../Applications/Instruments.app/Contents/PlugIns",
"AutomationInstrument.bundle/Contents/Resources",
"Automation.tracetemplate");
should be changed to
var xcodeTraceTemplatePath = path.resolve(xcodeFolderPath,
"../Applications/Instruments.app/Contents/PlugIns",
"AutomationInstrument.xrplugin/Contents/Resources",
"Automation.tracetemplate");
See the discussion here for more information on Appium with XCode 6: https://groups.google.com/forum/#!topic/appium-discuss/35_0RXJ2azc

Related

Fastlane testing tries to boot another device

I'm starting project unit tests via fastlane.
I have 2 devices for testing: iPad Air 2 and iPhone 6 plus.
But in console I can see next lines:
SimDevice: iPhone 6 Plus (<device code removed>, iOS 11.4, Booted)
(11.4 (15F79))
2018-11-16 14:34:45.608 xcodebuild[42659:1368186]
iPhoneConnect: ## Unable to mount developer disk image,
(Error Domain=com.apple.dtdevicekit Code=601 "Could not
locate device support files." UserInfo={DeviceType=iPhone9,3,
NSLocalizedDescription=Could not locate device support files.,
NSLocalizedRecoverySuggestion=This iPhone 7 (Model 1660, 1778, 1779, 1780)
is running iOS 12.0 (16A366), which may not be supported by this version of Xcode.})
The question is for which tasks does it try to mount disk image and boot iPhone 7 for tests? Btw it loops on this.
What does it mean?
Note: I have 2 XCode's - 9 and 10. Maybe it affects somehow.
Edit 1.
I do start tests via scan (it is alias) command:
scan(
workspace: "Name.xcworkspace",
scheme: "Name",
clean: false,
devices: devices_for_testing
)
Btw, tests finally completed, but I want to know, why has this output appeared.

Flutter.io (dart) app fails to launch on iOS simulator

I have up-to-date OSX Sierra, up-to-date XCode with applicable plugins, and an iPhone 6 simulator open and ready.
I have followed all the directions at https://flutter.io/setup-macos/#ios-setup.
When I "flutter run" from Terminal, the app fails to install on the simulator with message:
Could not build the application for the simulator.
Error launching application on iPhone 6.
Here is what Terminal said...
Launching lib/main.dart on iPhone 6 in debug mode...
Running pod install... 8.5s
Running Xcode build... 24.1s
Failed to build iOS app
Error output from Xcode build:
↳
2017-11-22 13:13:38.122 xcodebuild[47659:25935636] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13510/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/Runtime/PBXTargetBuildContext.mm:757
Details: unexpected successful exit code from cancelled command <C0009:'CpResource app.flx':P12>
Object: <PBXTargetBuildContext: 0x7fccf1235200>
Method: -createCommandInvocationRecordFromInvocation:
Thread: <NSThread: 0x7fccf2847ea0>{number = 16, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **
The following build commands failed:
CopyPlistFile /Users/deborah/Desktop/chq_emulator/build/ios/Debug-iphonesimulator/Runner.app/GoogleService-Info.plist Runner/GoogleService-Info.plist
(1 failure)
Xcode's output:
↳
Build settings from command line:
ARCHS = x86_64
BUILD_DIR = /Users/deborah/Desktop/chq_emulator/build/ios
ONLY_ACTIVE_ARCH = YES
SDKROOT = iphonesimulator11.1
=== CLEAN TARGET leveldb-library OF PROJECT Pods WITH CONFIGURATION Debug ===
... list of subsidiary infomation ...
Could not build the application for the simulator.
Error launching application on iPhone 6.
Anyone else out there with advice for how to get Flutter going on the simulator?
Try running your Xcode first and make sure that it's up-to-date. Open the {flutter_project}/ios build on Xcode then try to run the iOS project on the Simulator from there.
If you're still having issues, you can run this command on your Terminal. This should set the path for the active developer directory.
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Failed to remote debugging on using command line `process connect connect://iOSIP:Port`

I'm reading the topic is LLDB and debugserver in iOS Reverse Engineering book and encountering an error in details as below.
All configuration is well.
But when I'm using the lldb of Xcode5 or Xcode6 , the command process connect connect:iOSIP:Port showed up an error as below,
(lldb) process connect connect://10.18.136.168:1234 Assertion failed:
(pointer_byte_size == m_host_arch.GetAddressByteSize()), function
GetHostInfo, file
/SourceCache/lldb/lldb-300.2.53/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp,
line 1266. Abort trap: 6
And when I'm using the lldb of Xcode8 , the command process connect connect:iOSIP:Port showed up an error as below,
(lldb) process connect connect://10.18.136.168:1234 Process 8147
stopped
* thread #1, stop reason = signal SIGSTOP
frame #0: 0x00000001987ace0c error: memory read failed for 0x1987ace00
Environment:
macOS Sierra
Xcode 8.3.2
Xcode 6.0.1
Xcode 5.0.2
iOS 8.2 jailbroken
I've tried the lldb of three versions of Xcode using the command line process connect connect://10.18.136.168:1234, all are failed.
After a little while, I've found a solution and I want to share it here.
Solution Link: http://bbs.iosre.com/t/failed-to-remote-debugging-on-using-command-line-process-connect-connect-iosip-port/8259/4
The problem is about the architecture of the device. When I thinned debugserver using armv7s architecture and it failed to attach process.
However, there is a webpage shown pointer_byte_size == m_host_arch.GetAddressByteSize() in function GetHostInfo in linking to https://reviews.llvm.org/file/data/j3cbbw4262e57hrbundw/PHID-FILE-vojdaczcpqpc5h2sl6hl/file .
So I thinned it by using arm64 to output an new debugserver, the command as shown below
lipo -thin arm64 debugserver -output debugserver
codesign -s - --entitlements ent.plist -f debugserver
Finally, it works to my iphone 5, and to debug any app are okay and smoothly.

Appium starting IoS default Map application in iphone4S : specified target process is invalid

I am currently trying to automate (starting the Default MAP-App) on real device (Iphone4S) with Appium.
I have the following code:
def setCapabilities():
desired_caps['platformName'] = 'iOS'
desired_caps['platformVersion'] = '8.1'
desired_caps['deviceName'] = 'iPhone4s'
desired_caps['udId'] = '<phoneUDID>'
desired_caps['bundleId'] = 'com.apple.Maps'
appium_url = 'http://0.0.0.0:4723/wd/hub'
webdriver.Remote(appium_url,desired_caps)
I kept getting an exception on the Client side
"Original error: Instruments crashed on Startup" ,
and on the Server side I have the following error:
Attempting to run app on real device with UDID -phoneUDID-
"Instruments Usage Error: Specified target process is invalid:
com.apple.Maps"
Instruments exited with code 255
I made sure that the bundleId is the correct one as is defined in the Default BundleId of Iphone, however I kept getting this error. I tried different Default Iphone package (com.apple.safari, com.apple.maps), all returned the same error.
How can I start the apple maps using appium as is written in the code snippet above?
-update : it seems I Need a developer assigned certificate for the app. It means native apps are not possible to be automated (more to be found out..)
I got the same error and have found two reasons that can make this happen:
The iOS version is not compatible with your Xcode version, e.g. Xcode 7.3.1 and iOS 10.0.1.
If your iOS device runs on 9.x or higher you might have forgot to "trust an Enterprise app" (Guidelines for installing custom enterprise apps on iOS)
Just for comparison if needed, this was my trace:
[debug] [Instruments] [INST STDERR] Instruments Usage Error: Specified target process is invalid: bundleid.of.my.app
instruments, version 7.3 (60134)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]]
[debug] [Instruments] Instruments exited with code 255
[Instruments] Error launching instruments: Instruments crashed on startup
My device is running under v9.3.4. Xcode version is 7.3.1. Also note that both iOS v10.0.1 and Xcode 8 is not yet supported by latest stable Appium v1.5.3.

Xamarin.iOS Error: The Apple iOS SDK is not installed. (iOS9, XCode 7 beta)

I have installed XCode 7 beta, Xamarin.iOS 8.99.4 and Xamarin Studio 5.9 on Mac OSX 10.10.5.
I refer this article. https://developer.xamarin.com/guides/ios/platform_features/introduction_to_ios9/ .
If I debug/run a Xamarin.iOS app on iOS Simulator (iOS9), it works well.
But when I debug/run it on my iPhone5s device (iOS9), Xamarin shows this error message.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: Error: The Apple iOS SDK is not installed. (ex33.iOS)
The "Build Output" window show following message.
__________________________________________________
Project "/Users/username/Projects/ex33/iOS/ex33.iOS.csproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: iPhone
Target _DetectAppManifest:
FindItemWithLogicalName Task
Items:
Info.plist
Entitlements.plist
packages.config
LogicalName: Info.plist
ProjectDir: /Users/username/Projects/ex33/iOS
ResourcePrefix: Resources
Target _DetectSdkLocations:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : The Apple iOS SDK is not installed.
DetectSdkLocations Task
TargetFrameworkIdentifier: Xamarin.iOS
TargetArchitectures: ARMv7, ARM64
SdkVersion: <null>
XamarinSdkRoot: /Library/Frameworks/Xamarin.iOS.framework/Versions/Current
SdkRoot: <null>
SdkDevPath: /Applications/Xcode-beta.app/Contents/Developer
SdkUsrPath: <null>
SdkPlatform: <null>
SdkIsSimulator: False
Task "DetectSdkLocations" execution -- FAILED
Done building target "_DetectSdkLocations" in project "/Users/username/Projects/ex33/iOS/ex33.iOS.csproj".-- FAILED
Done building project "/Users/username/Projects/ex33/iOS/ex33.iOS.csproj".-- FAILED
Build FAILED.
Errors:
/Users/username/Projects/ex33/iOS/ex33.iOS.csproj (Build) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_DetectSdkLocations target) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : The Apple iOS SDK is not installed.
0 Warning(s)
1 Error(s)
---------------------- Done ----------------------
What can I do?
P.S. When I debug/run a app in XCode 7 beta, it works on my iPhone well.
Check the preferences in Xamarin Studio.. you may need to change the Apple SDK path to point to the Beta location.
By default, it should be looking in the default location, but that will only be present if you have the General Release (non Beta) Xcode and iOS SDK installed too.

Resources