I am currently trying to use ALTool to upload my application IPA to App Store Connect as part of a build script.
These are the commands I am using:
xcrun altool --validate-app -f my-ipa-file.ipa -t ios --apiKey "MYAPIKEY" --apiIssuer "MYISSUERID"
xcrun altool --upload-app -f my-ipa-file.ipa -t ios --apiKey "MYAPIKEY" --apiIssuer "MYISSUERID"
My private key (p8) is located at
./private_keys/AuthKey_MYAPIKEY.p8
According to the altool --help command the tool will look in the following directories (in order) for a p8 file named AuthKey_<apikey>.p8:
./private_keys
~/private_keys
~/.private_keys
~/.appstoreconnect/private_keys
Considering the p8 file is in the first folder of that list, this should work.
And for the --validate-app call, it does actually work. The calls to App Store Connect are made, the app validates and if there are any errors from App Store Connect they return as expected.
However, for some reason the --upload-app command always returns with the same error:
2020-09-01 14:24:40.934 altool[28265:119010] * Error: Error uploading 'my-ipa-file.ipa'.
2020-09-01 14:24:40.934 altool[28265:119010] * Error: code -18000 (Could not locate the private key file: AuthKey_MYAPIKEY.p8)
For some reason it seems --upload-app doesn't properly load the p8 file in ./private_keys/ while --validate-app does.
Placing the p8 file in one of the other 3 folders (~/private_keys etc.) does work for both validate and upload as a temporary workaround. But I prefer to use ./private_keys due to how my build scripts injects files into the build process.
Is this a bug in altool or is there something I'm missing?
In GitHub actions I just put the api key into $RUNNER_TEMP. And then when running the xcrun altool I am doing it like so:
API_PRIVATE_KEYS_DIR=$RUNNER_TEMP xcrun altool
This is probably a bug.
When uploading an app, altool seems to invoke iTMSTransporter under the hood to do the actual uploading.
The latter changes current directory before running, so when it looks for ./private_keys/AuthKey_MYAPIKEY.p8 in current directory, it checks the wrong location.
See cd in /Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/itms/bin/iTMSTransporter.
I guess altool doesn't invoke iTMSTransporter when validating apps.
I am trying to setup Continuous Integration for IOS App using altool to upload IPA file to Test Flight. We have Two apps in one user Account. Now I want to upload two Different IPA's into their builds. But I couldn't found any command to do that.
Command:
$/Applications/Xcode.app/Contents/Applications/Application\Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/altool
$ altool --upload-app -f /path/to/app.ipa -u USERNAME -p PASSWORD
how do I upload two different App's(IPA) in one user account using altool.
You can upload app's using altool.
Write below script/commnd in Execute Shell of Add Build Step drop down.
In the first step you need to go to the path where ALTOOL is. (Note :- Make sure your Xcode version is greater than or equal to 8.3)
In second step perform commnd for upload app to testflight.
cd /Applications/Xcode8.3.3/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support/
./altool --upload-app -f PathOfYourIPA -u yourAccountID -p yourAccountPassword
For ex. My Path for IPA is :-
/Users/Shared/Jenkins/Home/workspace/JOB_NAME/build/artifacts/IPAName.ipa
I installed Wireshark and during the installation it showed an error but the installation itself completed. When I ran the program and tried to capture packets on my network, it showed this error:
I'm new to mac so i don't even know how to properly ask.
Could someone help me?
According to User: gmale's answer on ask.wireshark.org, he solved his problem in this way and I'm sure that it could solve yours as well. It says:
1- Open Terminal
To see your exact user name (for me that was AliGht)
2- Type 'whoami'
3- execute the following commands:
cd /dev
sudo chown AliGht:admin bp*
and enter your computer password:
4- now type this command:
ls -la | grep bp
The last command will display a list of files such as:
5- Make sure all of them have your user name and admin as the user/group. For some reason, the last one didn't get assigned properly so I had to run the command:
sudo chown AliGht:admin bpf4
so the last command fixed my problem as you see in the last image:
Done!
If your WireShark is open then close it and open it again.
All credits of this tutorial goes to user gmale on ask.wireshark.org,
If you want to open WireShark always as administrator then take a look to another post which I created a shortcut for it via Applescript, and this is the only way which you can open the WireShark always as administrator even when you turn off/on your mac.
I don't know how to solve this problem, but if you want a temporary fix, you can use the following command:
$ sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark
Wireshark provides the solution itself, along with the explanation of weird secrets:
add your user to the group "access_bpf" by commanding
sudo dseditgroup -o edit -a `whoami` -t user access_bpf
then launch Wireshark's script
sudo "/Library/Application Support/Wireshark/ChmodBPF/ChmodBPF";
That's all, because (as the script explains):
# Unfortunately, macOS's devfs is based on the old FreeBSD
# one, not the current one, so there's no way to configure it
# to create BPF devices with particular owners or groups. BPF
# devices on macOS are also non-cloning, that is they can
# be created on demand at any time. This startup item will
# pre-create a number of BPF devices, then make them owned by
# the access_bpf group, with permissions rw-rw----, so that
# anybody in the access_bpf group can use programs that capture
# or send raw packets.
If you want to open WireShark always as administrator I suggest to use AppleScript:
Open AppleScript: By pressing cmd+space and write AppleScript Editor in the Spotlight Search as picture below:
Then from File --> Choose NEW
In the open window write:
do shell script "/Applications/Wireshark.app/Contents/MacOS/Wireshark" ¬
with administrator privileges user name "username" password "password"
Change the "username" and "password" with yours. If you don't know your username in terminal write "whoami" to see your username, password is your computer password!.
Mine is look like this:
Now export your script as Application, by going to --> File --> Export , and change File Format to Application write a name for your file and Save it on your desktop like following pictures:
DONE now run your App from Desktop, and by this way your WireShark runs always by Admin Permission.
I have faced the same problem in MacOS High Sierra (v10.13.6). I have clean-up all dependency files and folders but nothing works for me.
Using the terminal, if I run the following command then it is working -
sudo chmod o+r /dev/bpf*
sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark
This should work.
Run the application from the terminal with the following command:
User$ **sudo Wireshark**
Wireshark should open and packet capture should work then.
Was having same issue with install and run permissions etc. Attempted a few of the above mentioned fixes and although they would come back with the desired result program still would not run properly even with uninstall/install in addition.Getting a bit overwhelmed with it not working after several remedies being attempted I came to one that was super simple and worked -
I simply set up/checked log in as root user. Here you can enable/disable root user account, enable log in account and change root password. So I just switched profiles from my Admin account to the Root account. (I am honestly not sure if its safe to do it this way, so thinking many of you have far more knowledge on this than me I'd appreciate your comments on that!) Also my understanding is that you cannot properly run sudo commands if root account is enabled - So probably just tuning it off if it were on would suffice, but I wanted a quick and easy install at that point. The steps are really easy:
support.apple.com/en-us/HT204012
Then just switch user accounts to root -Log in with "other" then type root and your password.
Now just install Wireshark and it should install and run properly!
**I don't think I would stay in root account after install.
Hope maybe this will help some!
I got same issue and then notice below document provide solution already.
https://www.wireshark.org/docs/wsug_html_chunked/ChBuildInstallOSXInstall.html
2.5. Installing Wireshark under macOS
The official macOS packages are distributed as disk images (.dmg) containing the application bundle. To install Wireshark simply open the disk image and drag Wireshark to your /Applications folder.
In order to capture packets, you must install the “ChmodBPF” launch daemon. You can do so by opening the Install ChmodBPF.pkg file in the Wireshark .dmg or from Wireshark iself by opening Wireshark → About Wireshark selecting the “Folders” tab, and double-clicking “macOS Extras”.
The installer package includes Wireshark along with ChmodBPF and system path packages. See the included Read me first.html file for more details.
I do not want to modify my folder permissions on my system device files like the accepted answer, but I was able to get permissions by opening Wireshark like this:
sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark
Bonus, you can add an alias to your ~/.zshrc:
alias ws="sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark"
Now execute the file: (or you can open a new terminal window)
source ~/.zshrc
Open wireshark with super user permissions:
ws
One of my targets is an external build tool that uses the defaults command to read a property list.
When a bot runs that tool, the defaults command fails to find the specified default:
defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString
> The domain/default pair of (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version, CFBundleShortVersionString) does not exist
Running that same command from a regular user's account works fine:
defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString
> 7.1
But for some reason it doesn't work for the _teamsserver user:
sudo -u _teamsserver defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString
> The domain/default pair of (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version, CFBundleShortVersionString) does not exist
…which is why the bot can't build.
Any idea why this doesn't work?
Thanks.
Try using PlistBuddy instead:
/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version.plist
Note that since 10.9, you should NOT use PlistBuddy for modifying preference files. Apple added a caching system to improve the performance of user preferences and it won't see changes made directly to preferences files. In that case, use the "defaults" command which uses the proper API to make preferences changes. My guess is that the preferences caching system may also be what's causing trouble when trying to use the "defaults" command with sudo to access a generic plist.
I have scripts set up to run as post- and pre-actions in my Xcode project's scheme. printf and puts in Ruby don't seem to print to the logs that show up on the Xcode continuous integration website's "Logs" tab. How can I print to this log file? Also, is there a way to find out where the log file is located?
Please forgive my naivety: I know very little about how OS X Server works. The Xcode CI web interface is the only place I can see the log file:
Note, this is a cross-post from: https://devforums.apple.com/message/908997#908997
Yes, writing to /tmp is what worked for me, here is an exerpt from one of my scripts:
exec > /tmp/testflight.log 2>&1
echo "uploading to testflight"
On the server running the xcode bot, your file should be there in /tmp as specified. I did not receive the permissions errors so maybe this will work for you.